mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
tests: Fuzz additional functions in the hex fuzzing harness
This commit is contained in:
parent
c7ea12d098
commit
4fe4de6364
1 changed files with 15 additions and 1 deletions
|
|
@ -2,8 +2,12 @@
|
|||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <core_io.h>
|
||||
#include <primitives/block.h>
|
||||
#include <rpc/util.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <uint256.h>
|
||||
#include <univalue.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
|
|
@ -19,4 +23,14 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
if (IsHex(random_hex_string)) {
|
||||
assert(ToLower(random_hex_string) == hex_data);
|
||||
}
|
||||
(void)IsHexNumber(random_hex_string);
|
||||
uint256 result;
|
||||
(void)ParseHashStr(random_hex_string, result);
|
||||
(void)uint256S(random_hex_string);
|
||||
try {
|
||||
(void)HexToPubKey(random_hex_string);
|
||||
} catch (const UniValue&) {
|
||||
}
|
||||
CBlockHeader block_header;
|
||||
(void)DecodeHexBlockHeader(block_header, random_hex_string);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue