]> Savannah Git Hosting - gnulib.git/commitdiff
ldexpl tests: Avoid test failure on MSVC 9.
authorBruno Haible <bruno@clisp.org>
Sat, 5 Nov 2011 16:00:34 +0000 (17:00 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 5 Nov 2011 16:00:34 +0000 (17:00 +0100)
* tests/test-ldexpl.c (main): Use a temporary variable for the expected
value. Needed in order to enforce the conversion from a value greater
than LDBL_MAX to Infinity.

ChangeLog
tests/test-ldexpl.c

index d07a4b1f459d79ad0c44d2a30f59face3abc0883..bbb4c0b530e0d975552143a7ab6c92d25c6f7f12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-05  Bruno Haible  <bruno@clisp.org>
+
+       ldexpl tests: Avoid test failure on MSVC 9.
+       * tests/test-ldexpl.c (main): Use a temporary variable for the expected
+       value. Needed in order to enforce the conversion from a value greater
+       than LDBL_MAX to Infinity.
+
 2011-11-05  Bruno Haible  <bruno@clisp.org>
 
        New modules 'at-internal', 'openat-h', split off from module 'openat'.
index 5e921f61e8e6b7001b0ddf64a6be1e278a03b90b..e78e9a5d85ad6f35cbdac0e52acd6c8c143cc585 100644 (file)
@@ -94,7 +94,12 @@ main ()
   for (i = 1, x = 1.73205L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
     {
       y = ldexpl (x, 0); ASSERT (y == x);
-      y = ldexpl (x, 5); ASSERT (y == x * 32.0L);
+      {
+        volatile long double expected;
+        y = ldexpl (x, 5);
+        expected = x * 32.0L;
+        ASSERT (y == expected);
+      }
       y = ldexpl (x, -5); ASSERT (y == x * 0.03125L);
     }
   for (i = 1, x = 1.73205L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)