Browse Source

test: Re-introduce JSON pretty printing in test builder

0.13
Wladimir J. van der Laan 9 years ago
parent
commit
2317ad7c56
  1. 6
      src/test/script_tests.cpp

6
src/test/script_tests.cpp

@ -585,11 +585,11 @@ BOOST_AUTO_TEST_CASE(script_build)
for (unsigned int idx = 0; idx < json_good.size(); idx++) { for (unsigned int idx = 0; idx < json_good.size(); idx++) {
const UniValue& tv = json_good[idx]; const UniValue& tv = json_good[idx];
tests_good.insert(tv.get_array().write()); tests_good.insert(tv.get_array().write(1,4));
} }
for (unsigned int idx = 0; idx < json_bad.size(); idx++) { for (unsigned int idx = 0; idx < json_bad.size(); idx++) {
const UniValue& tv = json_bad[idx]; const UniValue& tv = json_bad[idx];
tests_bad.insert(tv.get_array().write()); tests_bad.insert(tv.get_array().write(1,4));
} }
} }
@ -608,7 +608,7 @@ BOOST_AUTO_TEST_CASE(script_build)
} }
BOOST_FOREACH(TestBuilder& test, bad) { BOOST_FOREACH(TestBuilder& test, bad) {
test.Test(false); test.Test(false);
std::string str = test.GetJSON().write(); std::string str = test.GetJSON().write(1,4);
#ifndef UPDATE_JSON_TESTS #ifndef UPDATE_JSON_TESTS
if (tests_bad.count(str) == 0) { if (tests_bad.count(str) == 0) {
BOOST_CHECK_MESSAGE(false, "Missing auto script_invalid test: " + test.GetComment()); BOOST_CHECK_MESSAGE(false, "Missing auto script_invalid test: " + test.GetComment());

Loading…
Cancel
Save