Source-Changes-HG archive

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

[src/trunk]: src/regress/lib/libc/ieeefp/infinity Make this test the currentl...



details:   https://anonhg.NetBSD.org/src/rev/7988f2a7aa76
branches:  trunk
changeset: 554034:7988f2a7aa76
user:      kleink <kleink%NetBSD.org@localhost>
date:      Fri Oct 24 16:35:08 2003 +0000

description:
Make this test the currently libc-internal isinfl() as well.
While I'm here, turn these into assert(3)-based tests.

diffstat:

 regress/lib/libc/ieeefp/infinity/Makefile   |   6 +++++-
 regress/lib/libc/ieeefp/infinity/infinity.c |  12 ++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r dc299a4c3974 -r 7988f2a7aa76 regress/lib/libc/ieeefp/infinity/Makefile
--- a/regress/lib/libc/ieeefp/infinity/Makefile Fri Oct 24 16:11:21 2003 +0000
+++ b/regress/lib/libc/ieeefp/infinity/Makefile Fri Oct 24 16:35:08 2003 +0000
@@ -1,9 +1,13 @@
-#      $NetBSD: Makefile,v 1.3 2002/09/18 05:41:38 lukem Exp $
+#      $NetBSD: Makefile,v 1.4 2003/10/24 16:35:08 kleink Exp $
 
 NOMAN=         # defined
 
 PROG=          infinity
 
+# the next two lines are required for _isinfl(), which is internal to libc
+CPPFLAGS+=     -I${NETBSDSRCDIR}/lib/libc/include
+CPPFLAGS+=     -D_LIBC
+
 regress: ${PROG}
        ./${PROG}
 
diff -r dc299a4c3974 -r 7988f2a7aa76 regress/lib/libc/ieeefp/infinity/infinity.c
--- a/regress/lib/libc/ieeefp/infinity/infinity.c       Fri Oct 24 16:11:21 2003 +0000
+++ b/regress/lib/libc/ieeefp/infinity/infinity.c       Fri Oct 24 16:35:08 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: infinity.c,v 1.1 2001/10/27 23:36:32 bjh21 Exp $       */
+/*     $NetBSD: infinity.c,v 1.2 2003/10/24 16:35:08 kleink Exp $      */
 
 /*
  * This file is in the Public Domain.
@@ -8,19 +8,19 @@
 
 /*
  * Check that HUGE_VAL (alias __infinity) really is infinite.
- * Alternatively, check that isinf() minimally works.
+ * Alternatively, check that isinf() and _isinfl() minimally work.
  */
 
-#include <err.h>
+#include "namespace.h"
+#include <assert.h>
 #include <math.h>
-#include <stdlib.h>
 
 int
 main(int argc, char **argv)
 {
 
        /* HUGE_VAL is meant to be an infinity. */
-       if (!isinf(HUGE_VAL))
-               errx(1, "Infinity isn't infinite");
+       assert(isinf(HUGE_VAL));
+       assert(_isinfl(HUGE_VAL));
        return 0;
 }



Home | Main Index | Thread Index | Old Index