From a538f0e438571be6e865972a5763acb652ba5bc3 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Tue, 2 Dec 2025 17:14:56 -0500 Subject: [PATCH] Add test case line numbers for Number_test::test_limits() - Aid tracking down tests that are only failing under certain configurations. --- src/test/basics/Number_test.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index e4bfcf2222..fa8b9e80be 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -46,22 +46,26 @@ public: } BEAST_EXPECT(caught); - auto test = [this](auto const& x, auto const& y) { + auto test = [this](auto const& x, auto const& y, int line) { auto const result = x == y; std::stringstream ss; ss << x << " == " << y << " -> " << (result ? "true" : "false"); - BEAST_EXPECTS(result, ss.str()); + expect(result, ss.str(), __FILE__, line); }; test( Number{false, minMantissa * 10, 32767, Number::normalized{}}, - Number{false, minMantissa, 32768, Number::normalized{}}); + Number{false, minMantissa, 32768, Number::normalized{}}, + __LINE__); test( - Number{false, minMantissa, -32769, Number::normalized{}}, Number{}); + Number{false, minMantissa, -32769, Number::normalized{}}, + Number{}, + __LINE__); test( Number{false, minMantissa, 32000, Number::normalized{}} * 1'000 + Number{false, 1'500, 32000, Number::normalized{}}, - Number{false, minMantissa + 2, 32003, Number::normalized{}}); + Number{false, minMantissa + 2, 32003, Number::normalized{}}, + __LINE__); // 9,223,372,036,854,775,808 test( @@ -70,14 +74,16 @@ public: scale == MantissaRange::small ? -9'223'372'036'854'776 : std::numeric_limits::min(), - 18 - Number::mantissaLog()}); + 18 - Number::mantissaLog()}, + __LINE__); test( Number{std::numeric_limits::max()}, Number{ scale == MantissaRange::small ? 9'223'372'036'854'776 : std::numeric_limits::max(), - 18 - Number::mantissaLog()}); + 18 - Number::mantissaLog()}, + __LINE__); caught = false; try {