This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use same tests for isfinite/finite, lgamma/gamma


On 05/24/2013 04:59 PM, Joseph S. Myers wrote:
Now that arrays of libm tests can be used to test more than one
function / macro with sufficiently similar semantics, this patch
arranges for the tests of finite to use the test data for isfinite,
and the tests of gamma to use the test data for lgamma.  Tested x86_64
and x86 and ulps updated accordingly (lgamma had more tests than
gamma; all the test for isfinite were already being run for finite as
well).

2013-05-24  Joseph Myers  <joseph@codesourcery.com>

	* math/libm-test.inc (finite_test_data): Remove.
	(finite_test): Run tests from isfinite_test_data.
	(gamma_test_data): Remove.
	(gamma_test): Run tests from lgamma_test_data.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 48ea02f..b0f9647 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8093,26 +8093,6 @@ fdim_test (void)
  }


-static const struct test_f_i_data finite_test_data[] =
-  {
-    TEST_f_b (finite, 0, 1, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, minus_zero, 1, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, 10, 1, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, min_subnorm_value, 1, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, plus_infty, 0, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, minus_infty, 0, NO_INEXACT_EXCEPTION),
-    TEST_f_b (finite, qnan_value, 0, NO_INEXACT_EXCEPTION),
-  };
-
-static void
-finite_test (void)
-{
-  START (finite);
-  RUN_TEST_LOOP_f_b (finite, finite_test_data, );
-  END;
-}
-
-
  static const struct test_f_f_data floor_test_data[] =
    {
      TEST_f_f (floor, 0.0, 0.0, NO_INEXACT_EXCEPTION),
@@ -9326,30 +9306,6 @@ frexp_test (void)
    END;
  }

-
-static const struct test_f_f1_data gamma_test_data[] =
-  {
-    TEST_f_f1 (gamma, plus_infty, plus_infty, 1),
-    TEST_f_f1 (gamma, 0, plus_infty, 1, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
-    TEST_f_f1 (gamma, -3, plus_infty, IGNORE, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
-    TEST_f_f1 (gamma, minus_infty, plus_infty, IGNORE),
-    TEST_f_f1 (gamma, qnan_value, qnan_value, IGNORE),
-
-    TEST_f_f1 (gamma, 1, 0, 1),
-    TEST_f_f1 (gamma, 3, M_LN2l, 1),
-
-    TEST_f_f1 (gamma, 0.5, M_LOG_SQRT_PIl, 1),
-    TEST_f_f1 (gamma, -0.5, M_LOG_2_SQRT_PIl, -1),
-  };
-
-static void
-gamma_test (void)
-{
-  START (gamma);
-  RUN_TEST_LOOP_f_f1 (gamma, gamma_test_data, , signgam);
-  END;
-}
-
  static const struct test_ff_f_data hypot_test_data[] =
    {
      TEST_ff_f (hypot, plus_infty, 1, plus_infty),
@@ -9455,6 +9411,14 @@ isfinite_test (void)
    END;
  }

+static void
+finite_test (void)
+{
+  START (finite);
+  RUN_TEST_LOOP_f_b (finite, isfinite_test_data, );

Please add a comment here that you share the test data between the functions and thus this is no error.

+  END;
+}
+
  static const struct test_ff_i_data isgreater_test_data[] =
    {
      TEST_ff_i (isgreater, minus_zero, minus_zero, 0, NO_INEXACT_EXCEPTION),
@@ -9909,6 +9873,14 @@ lgamma_test (void)
    END;
  }

+static void
+gamma_test (void)
+{
+  START (gamma);
+  RUN_TEST_LOOP_f_f1 (gamma, lgamma_test_data, , signgam);

And here a comment as well.
+  END;
+}
+

The rest is fine, thanks,
Andreas
--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]