Browse Source

Merge pull request #3712

a3138ed add test of DecodeBase58 skipping whitespace (Christian von Roques)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
3198604293
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/test/base58_tests.cpp

6
src/test/base58_tests.cpp

@ -63,6 +63,12 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58) @@ -63,6 +63,12 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
}
BOOST_CHECK(!DecodeBase58("invalid", result));
// check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end.
BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result));
BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result));
std::vector<unsigned char> expected = ParseHex("971a55");
BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());
}
// Visitor to check address type

Loading…
Cancel
Save