@@ -583,11 +583,13 @@ BOOST_AUTO_TEST_CASE(script_build)
583583 Array json_good = read_json (std::string (json_tests::script_valid, json_tests::script_valid + sizeof (json_tests::script_valid)));
584584 Array json_bad = read_json (std::string (json_tests::script_invalid, json_tests::script_invalid + sizeof (json_tests::script_invalid)));
585585
586- BOOST_FOREACH (Value& tv, json_good) {
587- tests_good.insert (write_string (Value (tv.get_array ()), true ));
586+ for (unsigned int idx = 0 ; idx < json_good.size (); idx++) {
587+ const Value& tv = json_good[idx];
588+ tests_good.insert (tv.get_array ().write ());
588589 }
589- BOOST_FOREACH (Value& tv, json_bad) {
590- tests_bad.insert (write_string (Value (tv.get_array ()), true ));
590+ for (unsigned int idx = 0 ; idx < json_bad.size (); idx++) {
591+ const Value& tv = json_bad[idx];
592+ tests_bad.insert (tv.get_array ().write ());
591593 }
592594 }
593595
@@ -596,7 +598,7 @@ BOOST_AUTO_TEST_CASE(script_build)
596598
597599 BOOST_FOREACH (TestBuilder& test, good) {
598600 test.Test (true );
599- std::string str = write_string ( Value ( test.GetJSON ()), true );
601+ std::string str = test.GetJSON (). write ( );
600602#ifndef UPDATE_JSON_TESTS
601603 if (tests_good.count (str) == 0 ) {
602604 BOOST_CHECK_MESSAGE (false , " Missing auto script_valid test: " + test.GetComment ());
@@ -606,7 +608,7 @@ BOOST_AUTO_TEST_CASE(script_build)
606608 }
607609 BOOST_FOREACH (TestBuilder& test, bad) {
608610 test.Test (false );
609- std::string str = write_string ( Value ( test.GetJSON ()), true );
611+ std::string str = test.GetJSON (). write ( );
610612#ifndef UPDATE_JSON_TESTS
611613 if (tests_bad.count (str) == 0 ) {
612614 BOOST_CHECK_MESSAGE (false , " Missing auto script_invalid test: " + test.GetComment ());
0 commit comments