diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-30 21:09:39 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-30 21:10:21 +0100 |
commit | 9553102c38c0ba4de48b35f3a13191fbc0e4cf09 (patch) | |
tree | eee5d1438d89b9eddfd206bcfc2eefb72c3d0171 /src/test/fuzz/fuzz.h | |
parent | 77339e5c244b183dd6e8d93f6b7bdf1d00849024 (diff) | |
parent | 2ca632e5b44a8385989c8539cc4e30e60fdee16c (diff) | |
download | bitcoin-9553102c38c0ba4de48b35f3a13191fbc0e4cf09.tar.xz |
Merge #15043: test: Build fuzz targets into seperate executables
2ca632e5b44a8385989c8539cc4e30e60fdee16c test: Build fuzz targets into seperate executables (MarcoFalke)
fab4bed68a3964ace5620a25d32d62ed87003126 [test] fuzz: make test_one_input return void (MarcoFalke)
Pull request description:
Currently our fuzzer is a single binary that decides on the first few bits of the buffer what target to pick. This is ineffective as the fuzzer needs to "learn" how the fuzz targets are organized and could get easily confused. Not to mention that the (seed) corpus can not be categorized by target, since targets might "leak" into each other. Also the corpus would potentially become invalid if we ever wanted to remove a target...
Solve that by building each fuzz target into their own executable.
Tree-SHA512: a874febc85a3c5e6729199542b65cad10640553fba6f663600c827fe144543744dd0f844fb62b4c95c6a04c670bfce32cdff3d5f26de2dfc25f10b258eda18ab
Diffstat (limited to 'src/test/fuzz/fuzz.h')
-rw-r--r-- | src/test/fuzz/fuzz.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/fuzz/fuzz.h b/src/test/fuzz/fuzz.h new file mode 100644 index 0000000000..ad62a5faf0 --- /dev/null +++ b/src/test/fuzz/fuzz.h @@ -0,0 +1,17 @@ +// Copyright (c) 2009-2019 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_TEST_FUZZ_FUZZ_H +#define BITCOIN_TEST_FUZZ_FUZZ_H + +#include <functional> +#include <stdint.h> +#include <vector> + + +const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; + +void test_one_input(std::vector<uint8_t> buffer); + +#endif // BITCOIN_TEST_FUZZ_FUZZ_H |