Commit 3878d846 authored by Jon Skeet's avatar Jon Skeet

Fix mistakes in highest-representable float64 integers

parent fe066bd5
...@@ -477,7 +477,7 @@ namespace Google.Protobuf ...@@ -477,7 +477,7 @@ namespace Google.Protobuf
[TestCase("-1", -1L)] [TestCase("-1", -1L)]
// long.MaxValue isn't actually representable as a double. This string value is the highest // long.MaxValue isn't actually representable as a double. This string value is the highest
// representable value which isn't greater than long.MaxValue. // representable value which isn't greater than long.MaxValue.
[TestCase("9223372036854769664", 9223372036854769664)] [TestCase("9223372036854774784", 9223372036854774784)]
[TestCase("-9223372036854775808", -9223372036854775808)] [TestCase("-9223372036854775808", -9223372036854775808)]
public void NumberToInt64_Valid(string jsonValue, long expectedParsedValue) public void NumberToInt64_Valid(string jsonValue, long expectedParsedValue)
{ {
...@@ -504,7 +504,7 @@ namespace Google.Protobuf ...@@ -504,7 +504,7 @@ namespace Google.Protobuf
[TestCase("1", 1UL)] [TestCase("1", 1UL)]
// ulong.MaxValue isn't representable as a double. This value is the largest double within // ulong.MaxValue isn't representable as a double. This value is the largest double within
// the range of ulong. // the range of ulong.
[TestCase("18446744073709500416", 18446744073709500416UL)] [TestCase("18446744073709549568", 18446744073709549568UL)]
public void NumberToUInt64_Valid(string jsonValue, ulong expectedParsedValue) public void NumberToUInt64_Valid(string jsonValue, ulong expectedParsedValue)
{ {
string json = "{ \"singleUint64\": " + jsonValue + "}"; string json = "{ \"singleUint64\": " + jsonValue + "}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment