]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use ALL_RM_TEST for more libm tests.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 19 Mar 2014 16:17:22 +0000 (16:17 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 19 Mar 2014 16:17:22 +0000 (16:17 +0000)
Continuing the move to using ALL_RM_TEST for tests in libm-test.inc,
this patch converts the tests of fdim, ldexp and scalb.  fdim and
scalb are cases where tests could depend on the rounding mode though
none of the present test inputs do; ldexp is such a case where the
function is equivalent to scalbn (for binary floating point) and the
tests used were a subset of those for scalbn, so this patch makes
ldexp testing use the scalbn tests, as done for other cases of libm
function aliases.

Tested x86_64 and x86.

* math/libm-test.inc (fdim_test): Use ALL_RM_TEST.
(ldexp_test_data): Remove.
(ldexp_test): Move to after scalbn_test.  Use ALL_RM_TEST with
scalbn_test_data.
(scalb_test): Use ALL_RM_TEST.

ChangeLog
math/libm-test.inc

index edffa1c3db2957462bd4a93a60c0bd4bdb9294c4..f48f6bb4e324b551795f85e2b5dc27a5c342850f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-03-19  Joseph Myers  <joseph@codesourcery.com>
+
+       * math/libm-test.inc (fdim_test): Use ALL_RM_TEST.
+       (ldexp_test_data): Remove.
+       (ldexp_test): Move to after scalbn_test.  Use ALL_RM_TEST with
+       scalbn_test_data.
+       (scalb_test): Use ALL_RM_TEST.
+
 2014-03-19  Andreas Schwab  <schwab@suse.de>
 
        * nscd/nscd.service: Also invalidate netgroup cache on reload.
index 5ad02555c0f3133c559b3942edfbb9964a2937e6..47c162fe27a1e35c95c78f040616c385ce63ce5d 100644 (file)
@@ -7445,9 +7445,7 @@ static const struct test_ff_f_data fdim_test_data[] =
 static void
 fdim_test (void)
 {
-  START (fdim, 1);
-  RUN_TEST_LOOP_ff_f (fdim, fdim_test_data, );
-  END;
+  ALL_RM_TEST (fdim, 1, fdim_test_data, RUN_TEST_LOOP_ff_f, END);
 }
 
 
@@ -8169,31 +8167,6 @@ jn_test (void)
 }
 
 
-static const struct test_fi_f_data ldexp_test_data[] =
-  {
-    TEST_fi_f (ldexp, 0, 0, 0, NO_INEXACT_EXCEPTION),
-    TEST_fi_f (ldexp, minus_zero, 0, minus_zero, NO_INEXACT_EXCEPTION),
-
-    TEST_fi_f (ldexp, plus_infty, 1, plus_infty, NO_INEXACT_EXCEPTION),
-    TEST_fi_f (ldexp, minus_infty, 1, minus_infty, NO_INEXACT_EXCEPTION),
-    TEST_fi_f (ldexp, qnan_value, 1, qnan_value, NO_INEXACT_EXCEPTION),
-
-    TEST_fi_f (ldexp, 0.8L, 4, 12.8L, NO_INEXACT_EXCEPTION),
-    TEST_fi_f (ldexp, -0.854375L, 5, -27.34L, NO_INEXACT_EXCEPTION),
-
-    /* ldexp (x, 0) == x.  */
-    TEST_fi_f (ldexp, 1.0L, 0L, 1.0L, NO_INEXACT_EXCEPTION),
-  };
-
-static void
-ldexp_test (void)
-{
-  START (ldexp, 1);
-  RUN_TEST_LOOP_fi_f (ldexp, ldexp_test_data, );
-  END;
-}
-
-
 static const struct test_f_f1_data lgamma_test_data[] =
   {
     TEST_f_f1 (lgamma, plus_infty, plus_infty, 1),
@@ -9784,10 +9757,7 @@ static const struct test_ff_f_data scalb_test_data[] =
 static void
 scalb_test (void)
 {
-
-  START (scalb, 1);
-  RUN_TEST_LOOP_ff_f (scalb, scalb_test_data, );
-  END;
+  ALL_RM_TEST (scalb, 1, scalb_test_data, RUN_TEST_LOOP_ff_f, END);
 }
 
 
@@ -9830,6 +9800,13 @@ scalbn_test (void)
   ALL_RM_TEST (scalbn, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END);
 }
 
+static void
+ldexp_test (void)
+{
+  /* ldexp uses the same test data as scalbn.  */
+  ALL_RM_TEST (ldexp, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END);
+}
+
 
 static const struct test_fl_f_data scalbln_test_data[] =
   {