@@ -9337,10 +9337,10 @@ public static void AssertJSONDouble(
93379337 String json ,
93389338 String numconv ,
93399339 double dbl ) {
9340- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9340+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
93419341 CBORObject [] cbors = {
93429342 FromJSON (json , numconv ),
9343- CBORDataUtilities .ParseJSONNumber (json , opt )
9343+ CBORDataUtilities .ParseJSONNumber (json , opt ),
93449344 };
93459345 for (CBORObject cbor : cbors ) {
93469346 if (cbor .getType () != CBORType .FloatingPoint ) {
@@ -9357,10 +9357,10 @@ public static void AssertJSONInteger(
93579357 String json ,
93589358 String numconv ,
93599359 long longval ) {
9360- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9360+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
93619361 CBORObject [] cbors = {
93629362 FromJSON (json , numconv ),
9363- CBORDataUtilities .ParseJSONNumber (json , opt )
9363+ CBORDataUtilities .ParseJSONNumber (json , opt ),
93649364 };
93659365 for (CBORObject cbor : cbors ) {
93669366 if (cbor .getType () != CBORType .Integer ) {
@@ -9379,10 +9379,10 @@ public static void AssertJSONInteger(
93799379 String json ,
93809380 String numconv ,
93819381 int intval ) {
9382- JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
9382+ JSONOptions opt = new JSONOptions ("numberconversion=" + numconv );
93839383 CBORObject [] cbors = {
93849384 FromJSON (json , numconv ),
9385- CBORDataUtilities .ParseJSONNumber (json , opt )
9385+ CBORDataUtilities .ParseJSONNumber (json , opt ),
93869386 };
93879387 for (CBORObject cbor : cbors ) {
93889388 if (cbor .getType () != CBORType .Integer ) {
@@ -9529,7 +9529,7 @@ public void TestFromJsonStringEDecimalSpec() {
95299529 for (int i = 0 ; i < 1000 ; ++i ) {
95309530 String [] decstring = new String [1 ];
95319531 EDecimal ed = RandomObjects .RandomEDecimal (rg , decstring );
9532- if (( decstring [0 ]) == null ) {
9532+ if (decstring [0 ] == null ) {
95339533 Assert .fail ();
95349534 }
95359535 double dbl = ed .ToDouble ();
@@ -9549,7 +9549,7 @@ public void TestFromJsonStringEDecimalSpec() {
95499549 public void TestFromJsonStringSmallDoubleSpec () {
95509550 RandomGenerator rg = new RandomGenerator ();
95519551 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 );
95539553 String rvstring = TestCommon .IntToString (rv );
95549554 AssertJSONDouble (
95559555 rvstring ,
@@ -9560,8 +9560,8 @@ public void TestFromJsonStringSmallDoubleSpec() {
95609560 "intorfloat" ,
95619561 rv );
95629562 }
9563- AssertJSONDouble ("511" ,"double" ,511 );
9564- AssertJSONDouble ("-511" ,"double" ,-511 );
9563+ AssertJSONDouble ("511" , "double" , 511 );
9564+ AssertJSONDouble ("-511" , "double" , -511 );
95659565 AssertJSONDouble (
95669566 TestCommon .IntToString (Integer .MAX_VALUE ),
95679567 "double" ,
@@ -9579,34 +9579,35 @@ public void TestFromJsonStringSmallDoubleSpec() {
95799579 @ Test (timeout = 10000 )
95809580 public void TestFromJsonStringSmallDouble () {
95819581 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" );
95849584 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" );
95909590 Assert .assertEquals (1 , cbor .size ());
95919591 Assert .assertEquals (0.0 , cbor .get (0 ).AsDouble ());
9592- cbor = FromJSON ("[-0]" , "double" );
9592+ cbor = FromJSON ("[-0]" , "double" );
95939593 Assert .assertEquals (1 , cbor .size ());
9594- cbor = FromJSON ("[1]" , "double" );
9594+ cbor = FromJSON ("[1]" , "double" );
95959595 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" );
95989598 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" );
96019602 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 );
96109611 }
96119612
96129613 @ Test (timeout = 10000 )
0 commit comments