mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
tests: Add coverage of {,Incremental}DynamicUsage(const std::set<X, Y>& s) to existing fuzzer
This commit is contained in:
parent
bf76000493
commit
283bd72156
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <limits>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
void initialize()
|
||||
|
@ -114,6 +115,12 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
(void)memusage::DynamicUsage(u8);
|
||||
const unsigned char uch = static_cast<unsigned char>(u8);
|
||||
(void)memusage::DynamicUsage(uch);
|
||||
{
|
||||
const std::set<int64_t> i64s{i64, static_cast<int64_t>(u64)};
|
||||
const size_t dynamic_usage = memusage::DynamicUsage(i64s);
|
||||
const size_t incremental_dynamic_usage = memusage::IncrementalDynamicUsage(i64s);
|
||||
assert(dynamic_usage == incremental_dynamic_usage * i64s.size());
|
||||
}
|
||||
(void)MillisToTimeval(i64);
|
||||
const double d = ser_uint64_to_double(u64);
|
||||
assert(ser_double_to_uint64(d) == u64);
|
||||
|
|
Loading…
Add table
Reference in a new issue