tests: Fill fuzzing coverage gaps for functions in script/script.h, script/script_error.h and script/standard.h

This commit is contained in:
practicalswift
2020-05-16 18:15:13 +00:00
parent c571ecb071
commit 8de72711c6
2 changed files with 44 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <serialize.h>
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>
@@ -89,6 +90,10 @@ void test_one_input(const std::vector<uint8_t>& buffer)
(void)urlDecode(random_string_1);
(void)ValidAsCString(random_string_1);
(void)_(random_string_1.c_str());
try {
throw scriptnum_error{random_string_1};
} catch (const std::runtime_error&) {
}
{
CDataStream data_stream{SER_NETWORK, INIT_PROTO_VERSION};