-
Notifications
You must be signed in to change notification settings - Fork 37.8k
tests: Add fuzzing harnesses for functions in addrdb.h, net_permissions.h and timedata.h #18417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(void)median_filter.median(); | ||
assert(median_filter.size() > 0); | ||
assert(static_cast<size_t>(median_filter.size()) == median_filter.sorted().size()); | ||
assert(static_cast<unsigned int>(median_filter.size()) <= max_size || max_size == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
assert(static_cast<unsigned int>(median_filter.size()) <= max_size || max_size == 0); | |
assert(static_cast<unsigned int>(median_filter.size()) <= max_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is needed since max_size == 0
means unbounded size as CMedianFilter
is currently implemented :)
39d387e
to
4308aa6
Compare
} | ||
return CBanEntry{}; | ||
}(); | ||
assert(!ban_entry.banReasonToString().empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also add an AssertEqualAfterSerializeDeserialize
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid equality is not defined for CBanEntry
. That goes for quite a few of our classes :)
…data.h Summary: bitcoin/bitcoin@43ff0d9 --- Depends on D7133 Partial backport of Core [[bitcoin/bitcoin#18417 | PR18417]] Test Plan: cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ninja bitcoin-fuzzers ./src/test/fuzz/timedata Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D7134
…permissions.h Summary: bitcoin/bitcoin@4308aa6 --- Depends on D7134 Concludes backport of Core [[bitcoin/bitcoin#18417 | PR18417]] Test Plan: cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ninja bitcoin-fuzzers ./src/test/fuzz/net_permissions Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D7135
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
… net_permissions.h and timedata.h
backport: bitcoin#18417, bitcoin#18521, bitcoin#18529, bitcoin#18176, bitcoin#18423, bitcoin#17926, bitcoin#18353, bitcoin#18407, bitcoin#18455, bitcoin#18565, bitcoin#18867 (fuzzing harness backports: part 2)
… net_permissions.h and timedata.h
Add fuzzing harnesses for functions in
addrdb.h
,net_permissions.h
andtimedata.h
.