Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/integer.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | void test_one_input(const std::vector<uint8_t> &buffer) { | ||||
assert(ser_double_to_uint64(d) == u64); | assert(ser_double_to_uint64(d) == u64); | ||||
const float f = ser_uint32_to_float(u32); | const float f = ser_uint32_to_float(u32); | ||||
assert(ser_float_to_uint32(f) == u32); | assert(ser_float_to_uint32(f) == u32); | ||||
(void)SighashToStr(uch); | (void)SighashToStr(uch); | ||||
(void)SipHashUint256(u64, u64, u256); | (void)SipHashUint256(u64, u64, u256); | ||||
(void)SipHashUint256Extra(u64, u64, u256, u32); | (void)SipHashUint256Extra(u64, u64, u256, u32); | ||||
(void)ToLower(ch); | (void)ToLower(ch); | ||||
(void)ToUpper(ch); | (void)ToUpper(ch); | ||||
// ValueFromAmount(i) not defined when i == | // Amount::operator UniValue() not defined when Amount::amount == | ||||
// std::numeric_limits<int64_t>::min() | // std::numeric_limits<int64_t>::min() | ||||
if (i64 != std::numeric_limits<int64_t>::min()) { | if (i64 != std::numeric_limits<int64_t>::min()) { | ||||
Amount parsed_money; | Amount parsed_money; | ||||
if (ParseMoney(ValueFromAmount(i64 * SATOSHI).getValStr(), | if (ParseMoney(UniValue(i64 * SATOSHI).getValStr(), parsed_money)) { | ||||
parsed_money)) { | |||||
assert(parsed_money == i64 * SATOSHI); | assert(parsed_money == i64 * SATOSHI); | ||||
} | } | ||||
} | } | ||||
if (i32 >= 0 && i32 <= 16) { | if (i32 >= 0 && i32 <= 16) { | ||||
assert(i32 == CScript::DecodeOP_N(CScript::EncodeOP_N(i32))); | assert(i32 == CScript::DecodeOP_N(CScript::EncodeOP_N(i32))); | ||||
} | } | ||||
const std::chrono::seconds seconds{i64}; | const std::chrono::seconds seconds{i64}; | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |