diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-12-16 09:09:17 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-12-16 09:23:19 +0000 |
commit | 137c80d579502e329964d7d1028a9507d4667774 (patch) | |
tree | 7a1752ee0deef0570a1e8825cddb86d6f297175f /src/test/util_tests.cpp | |
parent | a6fc26da55dea3b76bd89fbbca24ded170238674 (diff) |
tests: Add tests for decoding/parsing of base32, base64 and money strings containing NUL characters
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r-- | src/test/util_tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index b9fcd97a8f..a5cbae89b4 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -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) |