From 7347a4f3a901f44adb80003c3987d37380bdbb84 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 27 Apr 2024 10:01:02 -0400 Subject: [PATCH] xo-unit: test: expand scope of rng quantity test + turn off debug --- utest/Quantity.test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utest/Quantity.test.cpp b/utest/Quantity.test.cpp index 511cdbe0..7c105a1b 100644 --- a/utest/Quantity.test.cpp +++ b/utest/Quantity.test.cpp @@ -213,8 +213,9 @@ namespace xo { REQUIRE(nu1_j.n_bpu() == 1); - /* pick power in {+1, -1} */ - int power = ((rng() % 2 == 0) ? +1 : -1); + int power = 1 + (rng() % 2); /* power in {1, 2} */ + if (rng() % 2) + power = -power; /* power in +/- {1,2} */ if (power == -1) nu1_j = nu1_j.reciprocal(); @@ -341,7 +342,7 @@ namespace xo { * 2. verify +,- by combining quantities with different units */ TEST_CASE("Quantity.full", "[Quantity.full]") { - constexpr bool c_debug_flag = true; + constexpr bool c_debug_flag = false; //auto rng = xo::rng::xoshiro256ss(seed);