aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/hex.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-11-10 10:49:58 +0100
committerMacroFake <falke.marco@gmail.com>2022-04-27 19:53:17 +0200
commitfae1006019188700e0c497a63fc1550fe00ca8bb (patch)
tree0b0befbf77427a934bb6aeffe1113095e8cb6e59 /src/test/fuzz/hex.cpp
parentfabdf81983e2542d60542b80fb94ccb1acdd204a (diff)
util: Add ParseHex<std::byte>() helper
Diffstat (limited to 'src/test/fuzz/hex.cpp')
-rw-r--r--src/test/fuzz/hex.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/fuzz/hex.cpp b/src/test/fuzz/hex.cpp
index cc1bc1c8cf..e637975b48 100644
--- a/src/test/fuzz/hex.cpp
+++ b/src/test/fuzz/hex.cpp
@@ -25,6 +25,8 @@ FUZZ_TARGET_INIT(hex, initialize_hex)
{
const std::string random_hex_string(buffer.begin(), buffer.end());
const std::vector<unsigned char> data = ParseHex(random_hex_string);
+ const std::vector<std::byte> bytes{ParseHex<std::byte>(random_hex_string)};
+ assert(AsBytes(Span{data}) == Span{bytes});
const std::string hex_data = HexStr(data);
if (IsHex(random_hex_string)) {
assert(ToLower(random_hex_string) == hex_data);