diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2017-10-25 22:08:10 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2017-10-25 22:08:10 +0200 |
commit | fd3a2f3130ebd1d1001c5dff80c1ff026654b00d (patch) | |
tree | 2999ce4252f93c42770f281d05b659e4d86d7d8b /src/test/test_bitcoin_fuzzy.cpp | |
parent | 57ee73990f1ce29916adfd99f93eae1ccea1a43b (diff) |
[tests] Add fuzz testing for BlockTransactions and BlockTransactionsRequest
Diffstat (limited to 'src/test/test_bitcoin_fuzzy.cpp')
-rw-r--r-- | src/test/test_bitcoin_fuzzy.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/test_bitcoin_fuzzy.cpp b/src/test/test_bitcoin_fuzzy.cpp index 581ad2ffa0..6694c5caa8 100644 --- a/src/test/test_bitcoin_fuzzy.cpp +++ b/src/test/test_bitcoin_fuzzy.cpp @@ -19,6 +19,7 @@ #include "undo.h" #include "version.h" #include "pubkey.h" +#include "blockencodings.h" #include <stdint.h> #include <unistd.h> @@ -45,6 +46,8 @@ enum TEST_ID { CBLOOMFILTER_DESERIALIZE, CDISKBLOCKINDEX_DESERIALIZE, CTXOUTCOMPRESSOR_DESERIALIZE, + BLOCKTRANSACTIONS_DESERIALIZE, + BLOCKTRANSACTIONSREQUEST_DESERIALIZE, TEST_ID_END }; @@ -245,6 +248,26 @@ int test_one_input(std::vector<uint8_t> buffer) { break; } + case BLOCKTRANSACTIONS_DESERIALIZE: + { + try + { + BlockTransactions bt; + ds >> bt; + } catch (const std::ios_base::failure& e) {return 0;} + + break; + } + case BLOCKTRANSACTIONSREQUEST_DESERIALIZE: + { + try + { + BlockTransactionsRequest btr; + ds >> btr; + } catch (const std::ios_base::failure& e) {return 0;} + + break; + } default: return 0; } |