diff options
author | stickies-v <stickies-v@protonmail.com> | 2024-08-20 14:59:28 +0100 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2024-08-23 13:53:40 +0100 |
commit | 2e58fdb544b538dba9823bcd5754d074272bfc04 (patch) | |
tree | d24f9e84844d20f79f314c7bc1f64b1dcbf54b1d /src/test | |
parent | 8a44d7d3c1e5d5af6779c3e4befe514c9dafb8ff (diff) |
util: remove unused IsHexNumber
The relevant unit tests have been incorporated in
uint256_tests/from_user_hex in a previous commit.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/hex.cpp | 1 | ||||
-rw-r--r-- | src/test/util_tests.cpp | 25 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/test/fuzz/hex.cpp b/src/test/fuzz/hex.cpp index 8bc0460bb8..0140c5947e 100644 --- a/src/test/fuzz/hex.cpp +++ b/src/test/fuzz/hex.cpp @@ -27,7 +27,6 @@ FUZZ_TARGET(hex) if (IsHex(random_hex_string)) { assert(ToLower(random_hex_string) == hex_data); } - (void)IsHexNumber(random_hex_string); if (uint256::FromHex(random_hex_string)) { assert(random_hex_string.length() == 64); assert(Txid::FromHex(random_hex_string)); diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index bf1fc1ea0a..c2c725d676 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -432,31 +432,6 @@ BOOST_AUTO_TEST_CASE(util_IsHex) BOOST_CHECK(!IsHex("0x0000")); } -BOOST_AUTO_TEST_CASE(util_IsHexNumber) -{ - BOOST_CHECK(IsHexNumber("0x0")); - BOOST_CHECK(IsHexNumber("0")); - BOOST_CHECK(IsHexNumber("0x10")); - BOOST_CHECK(IsHexNumber("10")); - BOOST_CHECK(IsHexNumber("0xff")); - BOOST_CHECK(IsHexNumber("ff")); - BOOST_CHECK(IsHexNumber("0xFfa")); - BOOST_CHECK(IsHexNumber("Ffa")); - BOOST_CHECK(IsHexNumber("0x00112233445566778899aabbccddeeffAABBCCDDEEFF")); - BOOST_CHECK(IsHexNumber("00112233445566778899aabbccddeeffAABBCCDDEEFF")); - - BOOST_CHECK(!IsHexNumber("")); // empty string not allowed - BOOST_CHECK(!IsHexNumber("0x")); // empty string after prefix not allowed - BOOST_CHECK(!IsHexNumber("0x0 ")); // no spaces at end, - BOOST_CHECK(!IsHexNumber(" 0x0")); // or beginning, - BOOST_CHECK(!IsHexNumber("0x 0")); // or middle, - BOOST_CHECK(!IsHexNumber(" ")); // etc. - BOOST_CHECK(!IsHexNumber("0x0ga")); // invalid character - BOOST_CHECK(!IsHexNumber("x0")); // broken prefix - BOOST_CHECK(!IsHexNumber("0x0x00")); // two prefixes not allowed - -} - BOOST_AUTO_TEST_CASE(util_seed_insecure_rand) { SeedRandomForTest(SeedRand::ZEROS); |