xo-unit: utest tidy

This commit is contained in:
Roland Conybeare 2024-04-28 18:39:43 -04:00
commit 8c70c0d837

View file

@ -19,17 +19,6 @@ namespace xo {
constexpr bpu_abbrev_type bpu_mpl_abbrev = bpu.abbrev();
TEST_CASE("bpu", "[bpu]") {
//constexpr bool c_debug_flag = false;
// can get bits from /dev/random by uncommenting the 2nd line below
//uint64_t seed = xxx;
//rng::Seed<xoshio256ss> seed;
//auto rng = xo::rng::xoshiro256ss(seed);
//scope log(XO_DEBUG2(c_debug_flag, "TEST_CASE.bpu"));
//log && log("(A)", xtag("foo", foo));
static_assert(bpu_mpl_abbrev<bpu64_type::unit_power(bu::gram)> == bpu64_type::unit_power(bu::gram).abbrev());
REQUIRE(bpu_mpl_abbrev<bpu64_type::unit_power(bu::gram)> == bpu64_type::unit_power(bu::gram).abbrev());
} /*TEST_CASE(bpu)*/
@ -37,14 +26,7 @@ namespace xo {
TEST_CASE("flatstring_from_exponent", "[flatstring_from_exponent]") {
constexpr bool c_debug_flag = false;
// can get bits from /dev/random by uncommenting the 2nd line below
//uint64_t seed = xxx;
//rng::Seed<xoshio256ss> seed;
//auto rng = xo::rng::xoshiro256ss(seed);
scope log(XO_DEBUG2(c_debug_flag, "TEST_CASE.flatstring_from_exponent"));
//log && log("(A)", xtag("foo", foo));
log && log(xtag("^-3", flatstring_from_exponent(-3,1)));
log && log(xtag("^-2", flatstring_from_exponent(-2,1)));
@ -75,16 +57,9 @@ namespace xo {
} /*TEST_CASE(flatstring_from_exponent)*/
TEST_CASE("bpu_abbrev", "[bpu_abbrev]") {
constexpr bool c_debug_flag = true;
// can get bits from /dev/random by uncommenting the 2nd line below
//uint64_t seed = xxx;
//rng::Seed<xoshio256ss> seed;
//auto rng = xo::rng::xoshiro256ss(seed);
constexpr bool c_debug_flag = false;
scope log(XO_DEBUG2(c_debug_flag, "TEST_CASE.bpu2_assemble_abbrev"));
//log && log("(A)", xtag("foo", foo));
log && log(xtag("1/(kg*kg)", bpu_abbrev(dim::mass, scalefactor_ratio_type(1000, 1), power_ratio_type(-2, 1))));
log && log(xtag("1/kg", bpu_abbrev(dim::mass, scalefactor_ratio_type(1000, 1), power_ratio_type(-1, 1))));