@@ -2488,20 +2488,22 @@ public void TestEncodeFloat64() {
24882488 }
24892489 }
24902490
2491+ public static final int [] EtbRanges = {
2492+ -24 , 23 , 1 ,
2493+ -256 , -25 , 2 ,
2494+ 24 , 255 , 2 ,
2495+ 256 , 266 , 3 ,
2496+ -266 , -257 , 3 ,
2497+ 65525 , 65535 , 3 ,
2498+ -65536 , -65525 , 3 ,
2499+ 65536 , 65546 , 5 ,
2500+ -65547 , -65537 , 5 ,
2501+ };
2502+
24912503 @ Test
24922504 public void TestEncodeToBytes () {
24932505 // Test minimum data length
2494- int [] ranges = {
2495- -24 , 23 , 1 ,
2496- -256 , -25 , 2 ,
2497- 24 , 255 , 2 ,
2498- 256 , 266 , 3 ,
2499- -266 , -257 , 3 ,
2500- 65525 , 65535 , 3 ,
2501- -65536 , -65525 , 3 ,
2502- 65536 , 65546 , 5 ,
2503- -65547 , -65537 , 5 ,
2504- };
2506+ int [] ranges = EtbRanges ;
25052507 String [] bigRanges = {
25062508 "4294967285" , "4294967295" ,
25072509 "4294967296" , "4294967306" ,
@@ -9749,9 +9751,11 @@ public void TestAtJSONPointer() {
97499751 cbor = CBORObject .NewMap ().Add ("f/o" , 0 );
97509752 Assert .assertEquals (cbor .get ("f/o" ), cbor .AtJSONPointer ("/f~1o" ));
97519753 cbor = CBORObject .NewMap ().Add ("foo" , CBORObject .NewMap ().Add ("bar" ,
9752- 345 ));
9754+ 345 ));
97539755
9754- Assert .assertEquals (CBORObject .FromObject (345 ), cbor .AtJSONPointer ("/foo/bar" ));
9756+ Assert .assertEquals (
9757+ CBORObject .FromObject (345 ),
9758+ cbor .AtJSONPointer ("/foo/bar" ));
97559759 cbor = CBORObject .NewMap ().Add ("foo" , CBORObject .NewArray ().Add (678 ));
97569760 Assert .assertEquals (CBORObject .FromObject (678 ), cbor .AtJSONPointer ("/foo/0" ));
97579761 try {
@@ -10360,7 +10364,7 @@ public static void TestParseNumberFxxLine(String line) {
1036010364
1036110365 public static void TestParseNumberFxx (
1036210366 String str ,
10363- short _f16 ,
10367+ short f16 ,
1036410368 int f32 ,
1036510369 long f64 ,
1036610370 String line ) {
@@ -10370,6 +10374,9 @@ public static void TestParseNumberFxx(
1037010374 // System.out.println(str);
1037110375 return ;
1037210376 }
10377+ if (CBORObject .FromObject (f16 ) == null ) {
10378+ Assert .fail ();
10379+ }
1037310380 CBORObject cbor = CBORDataUtilities .ParseJSONNumber (str ,
1037410381 JSONOptionsDouble );
1037510382 if (cbor == null ) {
@@ -10608,13 +10615,13 @@ public void TestFromJsonStringZeroWithHighExponent() {
1060810615 String decstr = "0E100441809235791722330759976" ;
1060910616 EDecimal ed = EDecimal .FromString (decstr );
1061010617 double dbl = ed .ToDouble ();
10611- Assert .assertEquals ((double )0 , dbl , 0 );
10618+ Assert .assertEquals ((double )0.0d , dbl , 0 );
1061210619 AssertJSONDouble (decstr , "double" , dbl );
1061310620 AssertJSONInteger (decstr , "intorfloat" , 0 );
1061410621 decstr = "0E1321909565013040040586" ;
1061510622 ed = EDecimal .FromString (decstr );
1061610623 dbl = ed .ToDouble ();
10617- Assert .assertEquals ((double )0 , dbl , 0 );
10624+ Assert .assertEquals ((double )0.0d , dbl , 0 );
1061810625 AssertJSONDouble (decstr , "double" , dbl );
1061910626 AssertJSONInteger (decstr , "intorfloat" , 0 );
1062010627 double dblnegzero = EFloat .FromString ("-0" ).ToDouble ();
@@ -10770,7 +10777,7 @@ public void TestFromJsonLeadingTrailingCTL() {
1077010777 }
1077110778 }
1077210779 // Trailing CTL
10773- chars = new char [] { (char )0x31 , (char )i };
10780+ chars = new char [] { (char )0x31 , (char )i };
1077410781 str = new String (chars , 0 , chars .length );
1077510782 if (i == 0x09 || i == 0x0d || i == 0x0a || i == 0x20 ) {
1077610783 try {
0 commit comments