9#include <boost/test/unit_test.hpp>
17static const
int64_t values[] = { 0, 1, -2, 127, 128, -255, 256, (1LL << 15) - 1, -(1LL << 16), (1LL << 24) - 1, (1LL << 31), 1 - (1LL << 32), 1LL << 40 };
19static const int64_t offsets[] = { 1, 0x79, 0x80, 0x81, 0xFF, 0x7FFF, 0x8000, 0xFFFF, 0x10000};
64 bool invalid = (((
num2 > 0) && (
num1 > (std::numeric_limits<int64_t>::max() -
num2))) ||
65 ((
num2 < 0) && (
num1 < (std::numeric_limits<int64_t>::min() -
num2))));
80 if (num != std::numeric_limits<int64_t>::min())
167 for(
size_t i = 0; i < std::size(
values); ++i)
169 for(
size_t j = 0;
j < std::size(
offsets); ++
j)
180 for(
size_t i = 0; i < std::size(
values); ++i)
182 for(
size_t j = 0;
j < std::size(
offsets); ++
j)
static const size_t nDefaultMaxNumSize
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_THROW(stmt, excMatch)
#define BOOST_CHECK(expr)
static void CheckAdd(const int64_t &num1, const int64_t &num2)
static void RunOperators(const int64_t &num1, const int64_t &num2)
static const int64_t offsets[]
static void CheckCompare(const int64_t &num1, const int64_t &num2)
static void CheckCreateVch(const int64_t &num)
static void CheckSubtract(const int64_t &num1, const int64_t &num2)
static void RunCreate(const int64_t &num)
static void CheckCreateInt(const int64_t &num)
static void CheckNegate(const int64_t &num)
static bool verify(const CScriptNum10 &bignum, const CScriptNum &scriptnum)
static const int64_t values[]
A selection of numbers that do not trigger int64_t overflow when added/subtracted.
BOOST_AUTO_TEST_CASE(creation)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.