Internals: Use auto in UASSERT_SELFTEST (#8299)

This commit is contained in:
Geza Lore
2026-09-06 17:16:08 -04:00
committed by GitHub
parent 0b824f160f
commit 62bec1bffc
7 changed files with 170 additions and 173 deletions
+16 -18
View File
@@ -2744,24 +2744,22 @@ void V3Number::selfTest() {
void V3Number::selfTestThis() {
// The self test has a "this" so UASSERT_SELFTEST/errorEndFatal works correctly
UASSERT_SELFTEST(const bool, V3Number::epsilonEqual(0, 0), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonEqual(1e19, 1e19), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonEqual(9, 0.0001), false);
UASSERT_SELFTEST(const bool,
V3Number::epsilonEqual(1, 1 + std::numeric_limits<double>::epsilon()), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonEqual(0.009, 0.00899999999999999931998839741709),
true);
UASSERT_SELFTEST(V3Number::epsilonEqual(0, 0), true);
UASSERT_SELFTEST(V3Number::epsilonEqual(1e19, 1e19), true);
UASSERT_SELFTEST(V3Number::epsilonEqual(9, 0.0001), false);
UASSERT_SELFTEST(V3Number::epsilonEqual(1, 1 + std::numeric_limits<double>::epsilon()), true);
UASSERT_SELFTEST(V3Number::epsilonEqual(0.009, 0.00899999999999999931998839741709), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(0), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(1), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(-1), true);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(1.0001), false);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(0.9999), false);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(-1.0001), false);
UASSERT_SELFTEST(const bool, V3Number::epsilonIntegral(-0.9999), false);
UASSERT_SELFTEST(V3Number::epsilonIntegral(0), true);
UASSERT_SELFTEST(V3Number::epsilonIntegral(1), true);
UASSERT_SELFTEST(V3Number::epsilonIntegral(-1), true);
UASSERT_SELFTEST(V3Number::epsilonIntegral(1.0001), false);
UASSERT_SELFTEST(V3Number::epsilonIntegral(0.9999), false);
UASSERT_SELFTEST(V3Number::epsilonIntegral(-1.0001), false);
UASSERT_SELFTEST(V3Number::epsilonIntegral(-0.9999), false);
UASSERT_SELFTEST(const int, log2b(0), 0);
UASSERT_SELFTEST(const int, log2b(1), 0);
UASSERT_SELFTEST(const int, log2b(0x40000000UL), 30);
UASSERT_SELFTEST(const int, log2bQuad(0x4000000000000000ULL), 62);
UASSERT_SELFTEST(log2b(0), 0);
UASSERT_SELFTEST(log2b(1), 0);
UASSERT_SELFTEST(log2b(0x40000000UL), 30);
UASSERT_SELFTEST(log2bQuad(0x4000000000000000ULL), 62);
}