projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: update copyright
[gnulib.git]
/
tests
/
test-isinf.c
diff --git
a/tests/test-isinf.c
b/tests/test-isinf.c
index
dffd990
..
0a13224
100644
(file)
--- a/
tests/test-isinf.c
+++ b/
tests/test-isinf.c
@@
-1,5
+1,5
@@
/* Test of isinf() substitute.
/* Test of isinf() substitute.
- Copyright (C) 2007-20
08
Free Software Foundation, Inc.
+ Copyright (C) 2007-20
14
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-19,24
+19,18
@@
#include <config.h>
#include <config.h>
+#include <math.h>
+
+/* isinf must be a macro. */
+#ifndef isinf
+# error missing declaration
+#endif
+
#include <float.h>
#include <limits.h>
#include <float.h>
#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "infinity.h"
+#include "macros.h"
float zerof = 0.0f;
double zerod = 0.0;
float zerof = 0.0f;
double zerod = 0.0;
@@
-60,8
+54,8
@@
test_isinff ()
ASSERT (!isinf (FLT_MAX));
ASSERT (!isinf (-FLT_MAX));
/* Infinite values. */
ASSERT (!isinf (FLT_MAX));
ASSERT (!isinf (-FLT_MAX));
/* Infinite values. */
- ASSERT (isinf (
1.0f / 0.0f
));
- ASSERT (isinf (-
1.0f / 0.0f
));
+ ASSERT (isinf (
Infinityf ()
));
+ ASSERT (isinf (-
Infinityf ()
));
/* Quiet NaN. */
ASSERT (!isinf (zerof / zerof));
#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
/* Quiet NaN. */
ASSERT (!isinf (zerof / zerof));
#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
@@
-106,8
+100,8
@@
test_isinfd ()
ASSERT (!isinf (DBL_MAX));
ASSERT (!isinf (-DBL_MAX));
/* Infinite values. */
ASSERT (!isinf (DBL_MAX));
ASSERT (!isinf (-DBL_MAX));
/* Infinite values. */
- ASSERT (isinf (
1.0 / 0.0
));
- ASSERT (isinf (-
1.0 / 0.0
));
+ ASSERT (isinf (
Infinityd ()
));
+ ASSERT (isinf (-
Infinityd ()
));
/* Quiet NaN. */
ASSERT (!isinf (zerod / zerod));
#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
/* Quiet NaN. */
ASSERT (!isinf (zerod / zerod));
#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
@@
-155,8
+149,8
@@
test_isinfl ()
ASSERT (!isinf (LDBL_MAX));
ASSERT (!isinf (-LDBL_MAX));
/* Infinite values. */
ASSERT (!isinf (LDBL_MAX));
ASSERT (!isinf (-LDBL_MAX));
/* Infinite values. */
- ASSERT (isinf (
1.0L / 0.0L
));
- ASSERT (isinf (-
1.0L / 0.0L
));
+ ASSERT (isinf (
Infinityl ()
));
+ ASSERT (isinf (-
Infinityl ()
));
/* Quiet NaN. */
ASSERT (!isinf (zerol / zerol));
/* Quiet NaN. */
ASSERT (!isinf (zerol / zerol));
@@
-178,7
+172,7
@@
test_isinfl ()
}
#endif
}
#endif
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
&& !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
# ifdef WORDS_BIGENDIAN
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
# ifdef WORDS_BIGENDIAN