mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-27 09:00:32 +00:00
@@ -123,6 +123,16 @@ struct base_uint_test : beast::unit_test::Suite
|
||||
{
|
||||
testcase("base_uint: fromRaw size mismatch");
|
||||
|
||||
// Container smaller than the base_uint (8 bytes vs 12 bytes for
|
||||
// test96). Only the first 8 bytes are copied; the remaining 4 bytes
|
||||
// stay zero.
|
||||
{
|
||||
Blob const tooSmall{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
test96 const result = test96::fromRaw(tooSmall);
|
||||
auto const resultText = to_string(result);
|
||||
BEAST_EXPECTS(resultText.substr(0, 16) == "0102030405060708", resultText);
|
||||
}
|
||||
|
||||
// Container larger than the base_uint (16 bytes vs 12 bytes for
|
||||
// test96). Only the first 12 bytes are copied; the extra bytes are
|
||||
// ignored.
|
||||
|
||||
Reference in New Issue
Block a user