mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 14:18:58 +02:00
test: remove test-only uint256S
uint256S was previously deprecated for being unsafe. All non-test
usage has already been removed in earlier commits.
1. Tests now use uint256::FromHex() or other constructors wherever
possible without further modification.
2. Tests that can't use uint256::FromHex() because they use input
with non-hex digit characters are
a) modified by dropping the non-hex digit characters if that
provides useful test coverage.
b) dropped if the test without non-hex digit characters does
not provide useful test coverage, e.g. because it is now
duplicated.
Additionally, use BOOST_CHECK_EQUAL where relevant on touched lines
to make error messages more readable.
This commit is contained in:
@@ -37,7 +37,6 @@ FUZZ_TARGET(hex)
|
||||
if (const auto result{uint256::FromUserHex(random_hex_string)}) {
|
||||
assert(uint256::FromHex(result->ToString()));
|
||||
}
|
||||
(void)uint256S(random_hex_string);
|
||||
try {
|
||||
(void)HexToPubKey(random_hex_string);
|
||||
} catch (const UniValue&) {
|
||||
|
||||
@@ -140,7 +140,7 @@ FUZZ_TARGET(integer, .init = initialize_integer)
|
||||
|
||||
const arith_uint256 au256 = UintToArith256(u256);
|
||||
assert(ArithToUint256(au256) == u256);
|
||||
assert(uint256S(au256.GetHex()) == u256);
|
||||
assert(uint256::FromHex(au256.GetHex()).value() == u256);
|
||||
(void)au256.bits();
|
||||
(void)au256.GetCompact(/* fNegative= */ false);
|
||||
(void)au256.GetCompact(/* fNegative= */ true);
|
||||
|
||||
Reference in New Issue
Block a user