unsigned int -> size_t for comparing with UniValue.size()
This commit is contained in:
@@ -28,7 +28,7 @@ BOOST_FIXTURE_TEST_SUITE(base58_tests, BasicTestingSetup)
|
||||
BOOST_AUTO_TEST_CASE(base58_EncodeBase58)
|
||||
{
|
||||
UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 2) // Allow for extra stuff (useful for comments)
|
||||
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
|
||||
UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));
|
||||
std::vector<unsigned char> result;
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 2) // Allow for extra stuff (useful for comments)
|
||||
@@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
|
||||
CBitcoinAddress addr;
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 3) // Allow for extra stuff (useful for comments)
|
||||
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
|
||||
UniValue tests = read_json(std::string(json_tests::base58_keys_valid, json_tests::base58_keys_valid + sizeof(json_tests::base58_keys_valid)));
|
||||
std::vector<unsigned char> result;
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 3) // Allow for extra stuff (useful for comments)
|
||||
@@ -251,7 +251,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_invalid)
|
||||
CBitcoinSecret secret;
|
||||
CBitcoinAddress addr;
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 1) // Allow for extra stuff (useful for comments)
|
||||
|
||||
@@ -583,11 +583,11 @@ BOOST_AUTO_TEST_CASE(script_build)
|
||||
UniValue json_good = read_json(std::string(json_tests::script_valid, json_tests::script_valid + sizeof(json_tests::script_valid)));
|
||||
UniValue json_bad = read_json(std::string(json_tests::script_invalid, json_tests::script_invalid + sizeof(json_tests::script_invalid)));
|
||||
|
||||
for (unsigned int idx = 0; idx < json_good.size(); idx++) {
|
||||
for (size_t idx = 0; idx < json_good.size(); idx++) {
|
||||
const UniValue& tv = json_good[idx];
|
||||
tests_good.insert(tv.get_array().write());
|
||||
}
|
||||
for (unsigned int idx = 0; idx < json_bad.size(); idx++) {
|
||||
for (size_t idx = 0; idx < json_bad.size(); idx++) {
|
||||
const UniValue& tv = json_bad[idx];
|
||||
tests_bad.insert(tv.get_array().write());
|
||||
}
|
||||
@@ -636,7 +636,7 @@ BOOST_AUTO_TEST_CASE(script_valid)
|
||||
// scripts.
|
||||
UniValue tests = read_json(std::string(json_tests::script_valid, json_tests::script_valid + sizeof(json_tests::script_valid)));
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
string strTest = test.write();
|
||||
if (test.size() < 3) // Allow size > 3; extra stuff ignored (useful for comments)
|
||||
@@ -661,7 +661,7 @@ BOOST_AUTO_TEST_CASE(script_invalid)
|
||||
// Scripts that should evaluate as invalid
|
||||
UniValue tests = read_json(std::string(json_tests::script_invalid, json_tests::script_invalid + sizeof(json_tests::script_invalid)));
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
string strTest = test.write();
|
||||
if (test.size() < 3) // Allow size > 2; extra stuff ignored (useful for comments)
|
||||
|
||||
@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(sighash_from_data)
|
||||
{
|
||||
UniValue tests = read_json(std::string(json_tests::sighash, json_tests::sighash + sizeof(json_tests::sighash)));
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 1) // Allow for extra stuff (useful for comments)
|
||||
|
||||
@@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
|
||||
|
||||
auto verifier = libzcash::ProofVerifier::Strict();
|
||||
ScriptError err;
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
string strTest = test.write();
|
||||
if (test[0].isArray())
|
||||
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
|
||||
map<COutPoint, CScript> mapprevOutScriptPubKeys;
|
||||
UniValue inputs = test[0].get_array();
|
||||
bool fValid = true;
|
||||
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
|
||||
for (size_t inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
|
||||
const UniValue& input = inputs[inpIdx];
|
||||
if (!input.isArray())
|
||||
{
|
||||
@@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
|
||||
|
||||
auto verifier = libzcash::ProofVerifier::Strict();
|
||||
ScriptError err;
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
for (size_t idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
string strTest = test.write();
|
||||
if (test[0].isArray())
|
||||
@@ -191,7 +191,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
|
||||
map<COutPoint, CScript> mapprevOutScriptPubKeys;
|
||||
UniValue inputs = test[0].get_array();
|
||||
bool fValid = true;
|
||||
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
|
||||
for (size_t inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
|
||||
const UniValue& input = inputs[inpIdx];
|
||||
if (!input.isArray())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user