Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
3878d846
Commit
3878d846
authored
Jan 21, 2016
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mistakes in highest-representable float64 integers
parent
fe066bd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
JsonParserTest.cs
csharp/src/Google.Protobuf.Test/JsonParserTest.cs
+2
-2
No files found.
csharp/src/Google.Protobuf.Test/JsonParserTest.cs
View file @
3878d846
...
@@ -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
(
"92233720368547
69664"
,
922337203685476966
4
)]
[
TestCase
(
"92233720368547
74784"
,
922337203685477478
4
)]
[
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"
,
1U
L
)]
[
TestCase
(
"1"
,
1U
L
)]
// 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
(
"184467440737095
00416"
,
18446744073709500416
U
L
)]
[
TestCase
(
"184467440737095
49568"
,
18446744073709549568
U
L
)]
public
void
NumberToUInt64_Valid
(
string
jsonValue
,
ulong
expectedParsedValue
)
public
void
NumberToUInt64_Valid
(
string
jsonValue
,
ulong
expectedParsedValue
)
{
{
string
json
=
"{ \"singleUint64\": "
+
jsonValue
+
"}"
;
string
json
=
"{ \"singleUint64\": "
+
jsonValue
+
"}"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment