Changeset View
Changeset View
Standalone View
Standalone View
src/test/script_tests.cpp
Show First 20 Lines • Show All 2,406 Lines • ▼ Show 20 Lines | UniValue tests = read_json(std::string( | ||||
json_tests::script_tests + sizeof(json_tests::script_tests))); | json_tests::script_tests + sizeof(json_tests::script_tests))); | ||||
for (unsigned int idx = 0; idx < tests.size(); idx++) { | for (unsigned int idx = 0; idx < tests.size(); idx++) { | ||||
UniValue test = tests[idx]; | UniValue test = tests[idx]; | ||||
std::string strTest = test.write(); | std::string strTest = test.write(); | ||||
Amount nValue = Amount::zero(); | Amount nValue = Amount::zero(); | ||||
unsigned int pos = 0; | unsigned int pos = 0; | ||||
if (test.size() > 0 && test[pos].isArray()) { | if (test.size() > 0 && test[pos].isArray()) { | ||||
nValue = AmountFromValue(test[pos][0]); | nValue = test[pos][0]; | ||||
pos++; | pos++; | ||||
} | } | ||||
// Allow size > 3; extra stuff ignored (useful for comments) | // Allow size > 3; extra stuff ignored (useful for comments) | ||||
if (test.size() < 4 + pos) { | if (test.size() < 4 + pos) { | ||||
if (test.size() != 1) { | if (test.size() != 1) { | ||||
BOOST_ERROR("Bad test: " << strTest); | BOOST_ERROR("Bad test: " << strTest); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 934 Lines • Show Last 20 Lines |