Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen Make it compile on archs where NAN is not...



details:   https://anonhg.NetBSD.org/src/rev/cd134ed4f815
branches:  trunk
changeset: 790078:cd134ed4f815
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Sep 16 15:22:51 2013 +0000

description:
Make it compile on archs where NAN is not defined - previously it only
compiled by chance (and details of the __isnan macro) on vax.

diffstat:

 tests/lib/libc/gen/t_isnan.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 055b51b1b2d5 -r cd134ed4f815 tests/lib/libc/gen/t_isnan.c
--- a/tests/lib/libc/gen/t_isnan.c      Mon Sep 16 12:36:54 2013 +0000
+++ b/tests/lib/libc/gen/t_isnan.c      Mon Sep 16 15:22:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_isnan.c,v 1.1 2011/09/19 05:25:50 jruoho Exp $ */
+/* $NetBSD: t_isnan.c,v 1.2 2013/09/16 15:22:51 martin Exp $ */
 
 /*
  * This file is in the Public Domain.
@@ -21,9 +21,11 @@
 
 ATF_TC_BODY(isnan_basic, tc)
 {
+#ifdef NAN
        /* NAN is meant to be a (float)NaN. */
        ATF_CHECK(isnan(NAN) != 0);
        ATF_CHECK(isnan((double)NAN) != 0);
+#endif
 }
 
 ATF_TC(isinf_basic);
@@ -51,10 +53,12 @@
 
        arch = atf_config_get("atf_arch");
 
-       if (strcmp("vax", arch) == 0 || strcmp("m68000", arch) == 0)
+       if (strcmp("m68000", arch) == 0)
                atf_tc_skip("Test not applicable on %s", arch);
        else {
+#ifdef NAN
                ATF_TP_ADD_TC(tp, isnan_basic);
+#endif
                ATF_TP_ADD_TC(tp, isinf_basic);
        }
 



Home | Main Index | Thread Index | Old Index