forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuzz: Add coverage for CDataStream consumer
- Loading branch information
1 parent
546a076
commit 4ddbcd0
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// 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 <addrman.h> | ||
#include <net.h> | ||
#include <test/fuzz/FuzzedDataProvider.h> | ||
#include <test/fuzz/fuzz.h> | ||
#include <test/fuzz/util.h> | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
|
||
void initialize_data_stream_addr_man() | ||
{ | ||
InitializeFuzzingContext(); | ||
} | ||
|
||
FUZZ_TARGET_INIT(data_stream_addr_man, initialize_data_stream_addr_man) | ||
{ | ||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()}; | ||
CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider); | ||
CAddrMan addr_man; | ||
CAddrDB::Read(addr_man, data_stream); | ||
} |