From 5196ecb4850d62fd7117febcae5c5e3ebf3d77e6 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 8 Jun 2020 13:22:21 +0000 Subject: [PATCH] tests: Add InitializeFuzzingContext() for easy initialization of fuzzing context without debug logging (avoids writing to disk) --- src/test/fuzz/block.cpp | 4 ++-- src/test/fuzz/cuckoocache.cpp | 1 - src/test/fuzz/descriptor_parse.cpp | 5 ++--- src/test/fuzz/deserialize.cpp | 4 ++-- src/test/fuzz/eval_script.cpp | 4 ++-- src/test/fuzz/fuzz.cpp | 2 ++ src/test/fuzz/hex.cpp | 4 ++-- src/test/fuzz/integer.cpp | 3 +-- src/test/fuzz/key.cpp | 6 ++---- src/test/fuzz/key_io.cpp | 4 ++-- src/test/fuzz/message.cpp | 4 +--- src/test/fuzz/p2p_transport_deserializer.cpp | 4 ++-- src/test/fuzz/parse_univalue.cpp | 6 ++---- src/test/fuzz/pow.cpp | 3 +-- src/test/fuzz/psbt.cpp | 4 ++-- src/test/fuzz/script.cpp | 4 +--- src/test/fuzz/script_flags.cpp | 4 ++-- src/test/fuzz/signature_checker.cpp | 4 ++-- src/test/fuzz/transaction.cpp | 5 ++--- src/test/fuzz/util.h | 6 ++++++ 20 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/test/fuzz/block.cpp b/src/test/fuzz/block.cpp index d4a76aacd00690..b3797def664252 100644 --- a/src/test/fuzz/block.cpp +++ b/src/test/fuzz/block.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -20,7 +20,7 @@ void initialize() { - static const BasicTestingSetup basic_testing_setup{CBaseChainParams::REGTEST}; + InitializeFuzzingContext(); } void test_one_input(const std::vector& buffer) diff --git a/src/test/fuzz/cuckoocache.cpp b/src/test/fuzz/cuckoocache.cpp index 5b45aa79d8fa11..045e2c88ee8c4b 100644 --- a/src/test/fuzz/cuckoocache.cpp +++ b/src/test/fuzz/cuckoocache.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/src/test/fuzz/descriptor_parse.cpp b/src/test/fuzz/descriptor_parse.cpp index 4a655841b85d9c..199eb1d69bf608 100644 --- a/src/test/fuzz/descriptor_parse.cpp +++ b/src/test/fuzz/descriptor_parse.cpp @@ -2,16 +2,15 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include #include