From 4bb15b91c238acbd814983e4330a4171ad10f570 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Tue, 30 Jun 2026 22:54:06 -0400 Subject: [PATCH] Revert "Remove the _other_ test case" This reverts commit a16d15660e4881cc42a0623b76a6d45df54b9079. --- src/test/basics/base_uint_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index 93ece55e99..f1b1ec916a 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -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.