tests: Add tests for decoding/parsing of base32, base64 and money strings containing NUL characters

This commit is contained in:
practicalswift
2019-12-16 09:09:17 +00:00
parent a6fc26da55
commit 137c80d579
3 changed files with 27 additions and 0 deletions

View File

@@ -1069,6 +1069,11 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney)
// Parsing negative amounts must fail
BOOST_CHECK(!ParseMoney("-1", ret));
// Parsing strings with embedded NUL characters should fail
BOOST_CHECK(!ParseMoney(std::string("\0-1", 3), ret));
BOOST_CHECK(!ParseMoney(std::string("\01", 2), ret));
BOOST_CHECK(!ParseMoney(std::string("1\0", 2), ret));
}
BOOST_AUTO_TEST_CASE(util_IsHex)