diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-06-05 14:52:26 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-06-12 15:21:31 +0200 |
commit | faa41e29d5b90e62179d651f4010272dae685621 (patch) | |
tree | bb3f7db9c18d8c371665a0dd48c91b284be33ac0 /src/test/fuzz | |
parent | 5ee6b76c69d51158c13f6ad9ea1b264372e58d4d (diff) |
fuzz: Use std::span in FuzzBufferType
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/bitset.cpp | 6 | ||||
-rw-r--r-- | src/test/fuzz/fuzz.h | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/test/fuzz/bitset.cpp b/src/test/fuzz/bitset.cpp index 98fcddfb8d..7684337729 100644 --- a/src/test/fuzz/bitset.cpp +++ b/src/test/fuzz/bitset.cpp @@ -12,8 +12,8 @@ namespace { -/** Pop the first byte from a Span<const uint8_t>, and return it. */ -uint8_t ReadByte(Span<const uint8_t>& buffer) +/** Pop the first byte from a byte-span, and return it. */ +uint8_t ReadByte(FuzzBufferType& buffer) { if (buffer.empty()) return 0; uint8_t ret = buffer.front(); @@ -23,7 +23,7 @@ uint8_t ReadByte(Span<const uint8_t>& buffer) /** Perform a simulation fuzz test on BitSet type S. */ template<typename S> -void TestType(Span<const uint8_t> buffer) +void TestType(FuzzBufferType buffer) { /** This fuzz test's design is based on the assumption that the actual bits stored in the * bitsets and their simulations do not matter for the purpose of detecting edge cases, thus diff --git a/src/test/fuzz/fuzz.h b/src/test/fuzz/fuzz.h index ca74d53de7..c468cd39e3 100644 --- a/src/test/fuzz/fuzz.h +++ b/src/test/fuzz/fuzz.h @@ -5,10 +5,9 @@ #ifndef BITCOIN_TEST_FUZZ_FUZZ_H #define BITCOIN_TEST_FUZZ_FUZZ_H -#include <span.h> - #include <cstdint> #include <functional> +#include <span> #include <string_view> /** @@ -23,7 +22,7 @@ #define LIMITED_WHILE(condition, limit) \ for (unsigned _count{limit}; (condition) && _count; --_count) -using FuzzBufferType = Span<const uint8_t>; +using FuzzBufferType = std::span<const uint8_t>; using TypeTestOneInput = std::function<void(FuzzBufferType)>; struct FuzzTargetOptions { |