From 636f1e1f9299c72175228a461b547b819d63963f Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 25 Aug 2023 19:55:36 +0200 Subject: [PATCH] test: conditional compilation set for `constexpr` `round()` usage --- test/unit_test/static/iau_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit_test/static/iau_test.cpp b/test/unit_test/static/iau_test.cpp index 93cc5de8a..33ddec680 100644 --- a/test/unit_test/static/iau_test.cpp +++ b/test/unit_test/static/iau_test.cpp @@ -41,9 +41,11 @@ static_assert(isq::length(1 * LD) == 384'399 * si::kilo); static_assert(isq::length(1 * ly) == 9'460'730'472'580'800 * si::metre); static_assert(isq::length(10'000'000'000 * A) == 1 * si::metre); +#if __cpp_lib_constexpr_cmath || MP_UNITS_COMP_GCC // TODO Should the below work for `1 * pc`? If yes, how to extent the type and how to convert it to a floating-point // representation for comparison purposes? static_assert(round(isq::length(1.L * pc)) == 30'856'775'814'913'673 * si::metre); +#endif static_assert(isq::speed(1 * c_0) == 299'792'458 * (si::metre / si::second));