mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
tests: Add fuzzing harness for count_seconds(...)
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include <streams.h>
|
#include <streams.h>
|
||||||
#include <test/fuzz/FuzzedDataProvider.h>
|
#include <test/fuzz/FuzzedDataProvider.h>
|
||||||
#include <test/fuzz/fuzz.h>
|
#include <test/fuzz/fuzz.h>
|
||||||
|
#include <time.h>
|
||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
#include <util/moneystr.h>
|
#include <util/moneystr.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <chrono>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -124,6 +126,8 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||||||
assert(parsed_money == i64);
|
assert(parsed_money == i64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const std::chrono::seconds seconds{i64};
|
||||||
|
assert(count_seconds(seconds) == i64);
|
||||||
|
|
||||||
const arith_uint256 au256 = UintToArith256(u256);
|
const arith_uint256 au256 = UintToArith256(u256);
|
||||||
assert(ArithToUint256(au256) == u256);
|
assert(ArithToUint256(au256) == u256);
|
||||||
|
|||||||
Reference in New Issue
Block a user