@@ -9337,10 +9337,10 @@ public static void AssertJSONDouble(
9337
9337
String json ,
9338
9338
String numconv ,
9339
9339
double dbl ) {
9340
- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9340
+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9341
9341
CBORObject [] cbors = {
9342
9342
FromJSON (json , numconv ),
9343
- CBORDataUtilities .ParseJSONNumber (json , opt )
9343
+ CBORDataUtilities .ParseJSONNumber (json , opt ),
9344
9344
};
9345
9345
for (CBORObject cbor : cbors ) {
9346
9346
if (cbor .getType () != CBORType .FloatingPoint ) {
@@ -9357,10 +9357,10 @@ public static void AssertJSONInteger(
9357
9357
String json ,
9358
9358
String numconv ,
9359
9359
long longval ) {
9360
- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9360
+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9361
9361
CBORObject [] cbors = {
9362
9362
FromJSON (json , numconv ),
9363
- CBORDataUtilities .ParseJSONNumber (json , opt )
9363
+ CBORDataUtilities .ParseJSONNumber (json , opt ),
9364
9364
};
9365
9365
for (CBORObject cbor : cbors ) {
9366
9366
if (cbor .getType () != CBORType .Integer ) {
@@ -9379,10 +9379,10 @@ public static void AssertJSONInteger(
9379
9379
String json ,
9380
9380
String numconv ,
9381
9381
int intval ) {
9382
- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9382
+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9383
9383
CBORObject [] cbors = {
9384
9384
FromJSON (json , numconv ),
9385
- CBORDataUtilities .ParseJSONNumber (json , opt )
9385
+ CBORDataUtilities .ParseJSONNumber (json , opt ),
9386
9386
};
9387
9387
for (CBORObject cbor : cbors ) {
9388
9388
if (cbor .getType () != CBORType .Integer ) {
@@ -9529,7 +9529,7 @@ public void TestFromJsonStringEDecimalSpec() {
9529
9529
for (int i = 0 ; i < 1000 ; ++i ) {
9530
9530
String [] decstring = new String [1 ];
9531
9531
EDecimal ed = RandomObjects .RandomEDecimal (rg , decstring );
9532
- if (( decstring [0 ]) == null ) {
9532
+ if (decstring [0 ] == null ) {
9533
9533
Assert .fail ();
9534
9534
}
9535
9535
double dbl = ed .ToDouble ();
@@ -9549,7 +9549,7 @@ public void TestFromJsonStringEDecimalSpec() {
9549
9549
public void TestFromJsonStringSmallDoubleSpec () {
9550
9550
RandomGenerator rg = new RandomGenerator ();
9551
9551
for (int i = 0 ; i < 10000 ; ++i ) {
9552
- int rv = rg .GetInt32 (Integer .MAX_VALUE ) * (rg .GetInt32 (2 )* 2 - 1 );
9552
+ int rv = rg .GetInt32 (Integer .MAX_VALUE ) * (rg .GetInt32 (2 ) * 2 - 1 );
9553
9553
String rvstring = TestCommon .IntToString (rv );
9554
9554
AssertJSONDouble (
9555
9555
rvstring ,
@@ -9560,8 +9560,8 @@ public void TestFromJsonStringSmallDoubleSpec() {
9560
9560
"intorfloat" ,
9561
9561
rv );
9562
9562
}
9563
- AssertJSONDouble ("511" ,"double" ,511 );
9564
- AssertJSONDouble ("-511" ,"double" ,-511 );
9563
+ AssertJSONDouble ("511" , "double" , 511 );
9564
+ AssertJSONDouble ("-511" , "double" , -511 );
9565
9565
AssertJSONDouble (
9566
9566
TestCommon .IntToString (Integer .MAX_VALUE ),
9567
9567
"double" ,
@@ -9579,34 +9579,35 @@ public void TestFromJsonStringSmallDoubleSpec() {
9579
9579
@ Test (timeout = 10000 )
9580
9580
public void TestFromJsonStringSmallDouble () {
9581
9581
CBORObject cbor ;
9582
- AssertJSONDouble ("0" ,"double" ,0.0 );
9583
- cbor = FromJSON ("[0, 1, 2, 3]" , "double" );
9582
+ AssertJSONDouble ("0" , "double" , 0.0 );
9583
+ cbor = FromJSON ("[0, 1, 2, 3]" , "double" );
9584
9584
Assert .assertEquals (4 , cbor .size ());
9585
- Assert .assertEquals (0.0 , cbor .get (0 ).AsDouble ());
9586
- Assert .assertEquals (1.0 , cbor .get (1 ).AsDouble ());
9587
- Assert .assertEquals (2.0 , cbor .get (2 ).AsDouble ());
9588
- Assert .assertEquals (3.0 , cbor .get (3 ).AsDouble ());
9589
- cbor = FromJSON ("[0]" , "double" );
9585
+ Assert .assertEquals (( double ) 0.0 , cbor .get (0 ).AsDouble (), 0 );
9586
+ Assert .assertEquals (( double ) 1.0 , cbor .get (1 ).AsDouble (), 0 );
9587
+ Assert .assertEquals (( double ) 2.0 , cbor .get (2 ).AsDouble (), 0 );
9588
+ Assert .assertEquals (( double ) 3.0 , cbor .get (3 ).AsDouble (), 0 );
9589
+ cbor = FromJSON ("[0]" , "double" );
9590
9590
Assert .assertEquals (1 , cbor .size ());
9591
9591
Assert .assertEquals (0.0 , cbor .get (0 ).AsDouble ());
9592
- cbor = FromJSON ("[-0]" , "double" );
9592
+ cbor = FromJSON ("[-0]" , "double" );
9593
9593
Assert .assertEquals (1 , cbor .size ());
9594
- cbor = FromJSON ("[1]" , "double" );
9594
+ cbor = FromJSON ("[1]" , "double" );
9595
9595
Assert .assertEquals (1 , cbor .size ());
9596
- Assert .assertEquals (1.0 , cbor .get (0 ).AsDouble ());
9597
- cbor = FromJSON ("[-1]" , "double" );
9596
+ Assert .assertEquals (( double ) 1.0 , cbor .get (0 ).AsDouble (), 0 );
9597
+ cbor = FromJSON ("[-1]" , "double" );
9598
9598
Assert .assertEquals (1 , cbor .size ());
9599
- Assert .assertEquals (-1.0 , cbor .get (0 ).AsDouble ());
9600
- cbor =FromJSON ("[-1022,-1023,-1024,-1025,1022,1023,1024,1025]" , "double" );
9599
+ Assert .assertEquals ((double )-1.0 , cbor .get (0 ).AsDouble (), 0 );
9600
+ cbor = FromJSON ("[-1022,-1023,-1024,-1025,1022,1023,1024,1025]" ,
9601
+ "double" );
9601
9602
Assert .assertEquals (8 , cbor .size ());
9602
- Assert .assertEquals (-1022.0 , cbor .get (0 ).AsDouble ());
9603
- Assert .assertEquals (-1023.0 , cbor .get (1 ).AsDouble ());
9604
- Assert .assertEquals (-1024.0 , cbor .get (2 ).AsDouble ());
9605
- Assert .assertEquals (-1025.0 , cbor .get (3 ).AsDouble ());
9606
- Assert .assertEquals (1022.0 , cbor .get (4 ).AsDouble ());
9607
- Assert .assertEquals (1023.0 , cbor .get (5 ).AsDouble ());
9608
- Assert .assertEquals (1024.0 , cbor .get (6 ).AsDouble ());
9609
- Assert .assertEquals (1025.0 , cbor .get (7 ).AsDouble ());
9603
+ Assert .assertEquals (( double ) -1022.0 , cbor .get (0 ).AsDouble (), 0 );
9604
+ Assert .assertEquals (( double ) -1023.0 , cbor .get (1 ).AsDouble (), 0 );
9605
+ Assert .assertEquals (( double ) -1024.0 , cbor .get (2 ).AsDouble (), 0 );
9606
+ Assert .assertEquals (( double ) -1025.0 , cbor .get (3 ).AsDouble (), 0 );
9607
+ Assert .assertEquals (( double ) 1022.0 , cbor .get (4 ).AsDouble (), 0 );
9608
+ Assert .assertEquals (( double ) 1023.0 , cbor .get (5 ).AsDouble (), 0 );
9609
+ Assert .assertEquals (( double ) 1024.0 , cbor .get (6 ).AsDouble (), 0 );
9610
+ Assert .assertEquals (( double ) 1025.0 , cbor .get (7 ).AsDouble (), 0 );
9610
9611
}
9611
9612
9612
9613
@ Test (timeout = 10000 )
0 commit comments