@@ -2451,17 +2451,19 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
24512451 Json::String errs;
24522452 Json::CharReader* reader (b.newCharReader ());
24532453 {
2454- char const doc[] = " {\" a\" :NaN,\" b\" :Infinity,\" c\" :-Infinity}" ;
2454+ char const doc[] = " {\" a\" :NaN,\" b\" :Infinity,\" c\" :-Infinity, \" d \" :+Infinity }" ;
24552455 bool ok = reader->parse (doc, doc + std::strlen (doc), &root, &errs);
24562456 JSONTEST_ASSERT (ok);
24572457 JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
2458- JSONTEST_ASSERT_EQUAL (3u , root.size ());
2458+ JSONTEST_ASSERT_EQUAL (4u , root.size ());
24592459 double n = root[" a" ].asDouble ();
24602460 JSONTEST_ASSERT (std::isnan (n));
24612461 JSONTEST_ASSERT_EQUAL (std::numeric_limits<double >::infinity (),
24622462 root.get (" b" , 0.0 ));
24632463 JSONTEST_ASSERT_EQUAL (-std::numeric_limits<double >::infinity (),
24642464 root.get (" c" , 0.0 ));
2465+ JSONTEST_ASSERT_EQUAL (std::numeric_limits<double >::infinity (),
2466+ root.get (" d" , 0.0 ));
24652467 }
24662468
24672469 struct TestData {
@@ -2485,7 +2487,8 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
24852487 {__LINE__, false , " {\" a\" :.Infinity}" }, //
24862488 {__LINE__, false , " {\" a\" :_Infinity}" }, //
24872489 {__LINE__, false , " {\" a\" :_nfinity}" }, //
2488- {__LINE__, true , " {\" a\" :-Infinity}" } //
2490+ {__LINE__, true , " {\" a\" :-Infinity}" }, //
2491+ {__LINE__, true , " {\" a\" :+Infinity}" } //
24892492 };
24902493 for (const auto & td : test_data) {
24912494 bool ok = reader->parse (&*td.in .begin (), &*td.in .begin () + td.in .size (),
@@ -2499,7 +2502,7 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
24992502 }
25002503
25012504 {
2502- char const doc[] = " {\" posInf\" : Infinity, \" NegInf\" : -Infinity}" ;
2505+ char const doc[] = " {\" posInf\" : + Infinity, \" NegInf\" : -Infinity}" ;
25032506 bool ok = reader->parse (doc, doc + std::strlen (doc), &root, &errs);
25042507 JSONTEST_ASSERT (ok);
25052508 JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
0 commit comments