@@ -2451,17 +2451,19 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
2451
2451
Json::String errs;
2452
2452
Json::CharReader* reader (b.newCharReader ());
2453
2453
{
2454
- char const doc[] = " {\" a\" :NaN,\" b\" :Infinity,\" c\" :-Infinity}" ;
2454
+ char const doc[] = " {\" a\" :NaN,\" b\" :Infinity,\" c\" :-Infinity, \" d \" :+Infinity }" ;
2455
2455
bool ok = reader->parse (doc, doc + std::strlen (doc), &root, &errs);
2456
2456
JSONTEST_ASSERT (ok);
2457
2457
JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
2458
- JSONTEST_ASSERT_EQUAL (3u , root.size ());
2458
+ JSONTEST_ASSERT_EQUAL (4u , root.size ());
2459
2459
double n = root[" a" ].asDouble ();
2460
2460
JSONTEST_ASSERT (std::isnan (n));
2461
2461
JSONTEST_ASSERT_EQUAL (std::numeric_limits<double >::infinity (),
2462
2462
root.get (" b" , 0.0 ));
2463
2463
JSONTEST_ASSERT_EQUAL (-std::numeric_limits<double >::infinity (),
2464
2464
root.get (" c" , 0.0 ));
2465
+ JSONTEST_ASSERT_EQUAL (std::numeric_limits<double >::infinity (),
2466
+ root.get (" d" , 0.0 ));
2465
2467
}
2466
2468
2467
2469
struct TestData {
@@ -2485,7 +2487,8 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
2485
2487
{__LINE__, false , " {\" a\" :.Infinity}" }, //
2486
2488
{__LINE__, false , " {\" a\" :_Infinity}" }, //
2487
2489
{__LINE__, false , " {\" a\" :_nfinity}" }, //
2488
- {__LINE__, true , " {\" a\" :-Infinity}" } //
2490
+ {__LINE__, true , " {\" a\" :-Infinity}" }, //
2491
+ {__LINE__, true , " {\" a\" :+Infinity}" } //
2489
2492
};
2490
2493
for (const auto & td : test_data) {
2491
2494
bool ok = reader->parse (&*td.in .begin (), &*td.in .begin () + td.in .size (),
@@ -2499,7 +2502,7 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
2499
2502
}
2500
2503
2501
2504
{
2502
- char const doc[] = " {\" posInf\" : Infinity, \" NegInf\" : -Infinity}" ;
2505
+ char const doc[] = " {\" posInf\" : + Infinity, \" NegInf\" : -Infinity}" ;
2503
2506
bool ok = reader->parse (doc, doc + std::strlen (doc), &root, &errs);
2504
2507
JSONTEST_ASSERT (ok);
2505
2508
JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
0 commit comments