From 103b6ecce0f8e6d1366962c8748794067b2485fe Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 22 Apr 2020 13:53:50 +0000 Subject: tests: Add fuzzing coverage for TransactionErrorString(...) --- src/test/fuzz/kitchen_sink.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/fuzz/kitchen_sink.cpp (limited to 'src/test/fuzz') diff --git a/src/test/fuzz/kitchen_sink.cpp b/src/test/fuzz/kitchen_sink.cpp new file mode 100644 index 0000000000..92c56ae58d --- /dev/null +++ b/src/test/fuzz/kitchen_sink.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2020 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include + +#include +#include + +// The fuzzing kitchen sink: Fuzzing harness for functions that need to be +// fuzzed but a.) don't belong in any existing fuzzing harness file, and +// b.) are not important enough to warrant their own fuzzing harness file. +void test_one_input(const std::vector& buffer) +{ + FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); + + const TransactionError transaction_error = fuzzed_data_provider.PickValueInArray({TransactionError::OK, TransactionError::MISSING_INPUTS, TransactionError::ALREADY_IN_CHAIN, TransactionError::P2P_DISABLED, TransactionError::MEMPOOL_REJECTED, TransactionError::MEMPOOL_ERROR, TransactionError::INVALID_PSBT, TransactionError::PSBT_MISMATCH, TransactionError::SIGHASH_MISMATCH, TransactionError::MAX_FEE_EXCEEDED}); + (void)TransactionErrorString(transaction_error); +} -- cgit v1.2.3