mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
fuzz: make the parsed descriptor testing into a function
We'll be reusing it in the new target.
This commit is contained in:
parent
d23fda0584
commit
d60229ede5
@ -8,6 +8,14 @@
|
|||||||
#include <test/fuzz/fuzz.h>
|
#include <test/fuzz/fuzz.h>
|
||||||
#include <util/chaintype.h>
|
#include <util/chaintype.h>
|
||||||
|
|
||||||
|
/** Test a successfully parsed descriptor. */
|
||||||
|
static void TestDescriptor(const Descriptor& desc)
|
||||||
|
{
|
||||||
|
(void)desc.ToString();
|
||||||
|
(void)desc.IsRange();
|
||||||
|
(void)desc.IsSolvable();
|
||||||
|
}
|
||||||
|
|
||||||
void initialize_descriptor_parse()
|
void initialize_descriptor_parse()
|
||||||
{
|
{
|
||||||
ECC_Start();
|
ECC_Start();
|
||||||
@ -21,10 +29,6 @@ FUZZ_TARGET(descriptor_parse, .init = initialize_descriptor_parse)
|
|||||||
std::string error;
|
std::string error;
|
||||||
for (const bool require_checksum : {true, false}) {
|
for (const bool require_checksum : {true, false}) {
|
||||||
const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
|
const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
|
||||||
if (desc) {
|
if (desc) TestDescriptor(*desc);
|
||||||
(void)desc->ToString();
|
|
||||||
(void)desc->IsRange();
|
|
||||||
(void)desc->IsSolvable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user