@@ -377,6 +377,21 @@ static void TestParseDouble() {
377
377
d = d.Value () * 0.5 ;
378
378
}
379
379
}
380
+
381
+ // Issue 1249
382
+ TEST_DOUBLE (fullPrecision, " 0e100" , 0.0 );
383
+
384
+ // Issue 1251
385
+ TEST_DOUBLE (fullPrecision, " 128.74836467836484838364836483643636483648e-336" , 0.0 );
386
+
387
+ // Issue 1256
388
+ TEST_DOUBLE (fullPrecision,
389
+ " 6223372036854775296.1701512723685473547372536854755293372036854685477"
390
+ " 529752233737201701512337200972013723685473123372036872036854236854737"
391
+ " 247372368372367752975258547752975254729752547372368737201701512354737"
392
+ " 83723677529752585477247372368372368547354737253685475529752" ,
393
+ 6223372036854775808.0 );
394
+
380
395
#undef TEST_DOUBLE
381
396
}
382
397
@@ -443,7 +458,7 @@ TEST(Reader, ParseNumber_Error) {
443
458
for (int i = 1 ; i < 310 ; i++)
444
459
n1e309[i] = ' 0' ;
445
460
n1e309[310 ] = ' \0 ' ;
446
- TEST_NUMBER_ERROR (kParseErrorNumberTooBig , n1e309, 0 , 309 );
461
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , n1e309, 0 , 310 );
447
462
}
448
463
TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 1e309" , 0 , 5 );
449
464
@@ -455,6 +470,25 @@ TEST(Reader, ParseNumber_Error) {
455
470
TEST_NUMBER_ERROR (kParseErrorNumberMissExponent , " 1e" , 2 , 2 );
456
471
TEST_NUMBER_ERROR (kParseErrorNumberMissExponent , " 1e_" , 2 , 2 );
457
472
473
+ // Issue 849
474
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 1.8e308" , 0 , 7 );
475
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 5e308" , 0 , 5 );
476
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 1e309" , 0 , 5 );
477
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 1.0e310" , 0 , 7 );
478
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 1.00e310" , 0 , 8 );
479
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " -1.8e308" , 0 , 8 );
480
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " -1e309" , 0 , 6 );
481
+
482
+ // Issue 1253
483
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig , " 2e308" , 0 , 5 );
484
+
485
+ // Issue 1259
486
+ TEST_NUMBER_ERROR (kParseErrorNumberTooBig ,
487
+ " 88474320368547737236837236775298547354737253685475547552933720368546854775297525"
488
+ " 29337203685468547770151233720097201372368547312337203687203685423685123372036872"
489
+ " 03685473724737236837236775297525854775297525472975254737236873720170151235473783"
490
+ " 7236737247372368772473723683723456789012E66" , 0 , 283 );
491
+
458
492
#undef TEST_NUMBER_ERROR
459
493
}
460
494
0 commit comments