]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: remove brittle iszero_safe() test
authorDavid Seifert <soap@gentoo.org>
Fri, 28 Oct 2022 21:55:07 +0000 (23:55 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Oct 2022 02:18:44 +0000 (11:18 +0900)
The test relies on finite -> infinite conversion happening
when increasing DBL_MAX.

Fixes #25044.

src/test/test-math-util.c

index 0162bf7dc0433be4df774e464972cae790561c9d..9771576fcbb6b939ae9c6504cf1daa09ad92d19f 100644 (file)
@@ -54,16 +54,6 @@ TEST(iszero_safe) {
         assert_se( iszero_safe(DBL_MIN / -INFINITY));
         assert_se( iszero_safe(DBL_MAX / INFINITY / 2));
         assert_se( iszero_safe(DBL_MAX / -INFINITY * DBL_MAX));
-#if defined(__i386__) && !defined(__SSE2_MATH__)
-        /* On 32bit x86, -mfpmath=387 is the default and SSE2 is not used. Then, floating point values are
-         * calculated in 80bit, and truncated to the length of the used type (double in this case). Hence,
-         * DBL_MAX * 2 is temporary calculated as a normal value, and goes to zero when divided with
-         * INFINITY. See issue #25044. */
-        log_debug("i386 architecture without SSE2 is detected. "
-                  "Skipping \"assert_se(!iszero_safe(DBL_MAX * 2 / INFINITY))\".");
-#else
-        assert_se(!iszero_safe(DBL_MAX * 2 / INFINITY));
-#endif
 
         /* infinity / infinity is NaN */
         assert_se(!iszero_safe(INFINITY / INFINITY));