diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-03-11 12:31:51 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-03-11 12:51:26 +0000 |
commit | 08eab0f599a7be7b9b0256bfe9e3a793fe7450db (patch) | |
tree | 30d253337222acb75a2af34e5a62da50a82cdd31 /src/test/fuzz/netaddress.cpp | |
parent | 7a861a62c164ab9b07d6fca09b6a8176e688f1f6 (diff) |
tests: Add fuzzing of CSubNet, CNetAddr and CService related functions
Diffstat (limited to 'src/test/fuzz/netaddress.cpp')
-rw-r--r-- | src/test/fuzz/netaddress.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/fuzz/netaddress.cpp b/src/test/fuzz/netaddress.cpp index d14fc1eb6c..d8d53566c7 100644 --- a/src/test/fuzz/netaddress.cpp +++ b/src/test/fuzz/netaddress.cpp @@ -123,4 +123,12 @@ void test_one_input(const std::vector<uint8_t>& buffer) const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()}; assert((service == other_service) != (service != other_service)); + (void)(service < other_service); + + const CSubNet sub_net_copy_1{net_addr, other_net_addr}; + const CSubNet sub_net_copy_2{net_addr}; + + CNetAddr mutable_net_addr; + mutable_net_addr.SetIP(net_addr); + assert(net_addr == mutable_net_addr); } |