mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01: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
1 changed files with 9 additions and 5 deletions
|
@ -8,6 +8,14 @@
|
|||
#include <test/fuzz/fuzz.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()
|
||||
{
|
||||
ECC_Start();
|
||||
|
@ -21,10 +29,6 @@ FUZZ_TARGET(descriptor_parse, .init = initialize_descriptor_parse)
|
|||
std::string error;
|
||||
for (const bool require_checksum : {true, false}) {
|
||||
const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
|
||||
if (desc) {
|
||||
(void)desc->ToString();
|
||||
(void)desc->IsRange();
|
||||
(void)desc->IsSolvable();
|
||||
}
|
||||
if (desc) TestDescriptor(*desc);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue