mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
fuzz: increase FromHex() coverage
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
|
#include <util/transaction_identifier.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -27,7 +28,11 @@ FUZZ_TARGET(hex)
|
|||||||
assert(ToLower(random_hex_string) == hex_data);
|
assert(ToLower(random_hex_string) == hex_data);
|
||||||
}
|
}
|
||||||
(void)IsHexNumber(random_hex_string);
|
(void)IsHexNumber(random_hex_string);
|
||||||
(void)uint256::FromHex(random_hex_string);
|
if (uint256::FromHex(random_hex_string)) {
|
||||||
|
assert(random_hex_string.length() == 64);
|
||||||
|
assert(Txid::FromHex(random_hex_string));
|
||||||
|
assert(Wtxid::FromHex(random_hex_string));
|
||||||
|
}
|
||||||
(void)uint256S(random_hex_string);
|
(void)uint256S(random_hex_string);
|
||||||
try {
|
try {
|
||||||
(void)HexToPubKey(random_hex_string);
|
(void)HexToPubKey(random_hex_string);
|
||||||
|
|||||||
Reference in New Issue
Block a user