projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pread: Move AC_LIBOBJ invocations to module description.
[pspp]
/
tests
/
test-signbit.c
diff --git
a/tests/test-signbit.c
b/tests/test-signbit.c
index 95ba61305c95667bfc84f3eb5625014456c2676d..c8981498a1feb7dd398f68a479445e4a3525fb97 100644
(file)
--- a/
tests/test-signbit.c
+++ b/
tests/test-signbit.c
@@
-1,5
+1,5
@@
/* Test of signbit() substitute.
/* Test of signbit() substitute.
- Copyright (C) 2007
, 2008
Free Software Foundation, Inc.
+ Copyright (C) 2007
-2011
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
@@
-20,21
+20,16
@@
#include <math.h>
#include <math.h>
+/* signbit must be a macro. */
+#ifndef signbit
+# error missing declaration
+#endif
+
+#include <float.h>
#include <limits.h>
#include <limits.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 "minus-zero.h"
+#include "macros.h"
float zerof = 0.0f;
double zerod = 0.0;
float zerof = 0.0f;
double zerod = 0.0;
@@
-52,10
+47,10
@@
test_signbitf ()
ASSERT (signbit (-2.718e-30f));
/* Zeros. */
ASSERT (!signbit (0.0f));
ASSERT (signbit (-2.718e-30f));
/* Zeros. */
ASSERT (!signbit (0.0f));
- if (1.0f /
-
zerof < 0)
- ASSERT (signbit (
-
zerof));
+ if (1.0f /
minus_
zerof < 0)
+ ASSERT (signbit (
minus_
zerof));
else
else
- ASSERT (!signbit (
-
zerof));
+ ASSERT (!signbit (
minus_
zerof));
/* Infinite values. */
ASSERT (!signbit (1.0f / 0.0f));
ASSERT (signbit (-1.0f / 0.0f));
/* Infinite values. */
ASSERT (!signbit (1.0f / 0.0f));
ASSERT (signbit (-1.0f / 0.0f));
@@
-97,10
+92,10
@@
test_signbitd ()
ASSERT (signbit (-2.718e-30));
/* Zeros. */
ASSERT (!signbit (0.0));
ASSERT (signbit (-2.718e-30));
/* Zeros. */
ASSERT (!signbit (0.0));
- if (1.0 /
-
zerod < 0)
- ASSERT (signbit (
-
zerod));
+ if (1.0 /
minus_
zerod < 0)
+ ASSERT (signbit (
minus_
zerod));
else
else
- ASSERT (!signbit (
-
zerod));
+ ASSERT (!signbit (
minus_
zerod));
/* Infinite values. */
ASSERT (!signbit (1.0 / 0.0));
ASSERT (signbit (-1.0 / 0.0));
/* Infinite values. */
ASSERT (!signbit (1.0 / 0.0));
ASSERT (signbit (-1.0 / 0.0));
@@
-140,10
+135,10
@@
test_signbitl ()
ASSERT (signbit (-2.718e-30L));
/* Zeros. */
ASSERT (!signbit (0.0L));
ASSERT (signbit (-2.718e-30L));
/* Zeros. */
ASSERT (!signbit (0.0L));
- if (1.0L /
-
zerol < 0)
- ASSERT (signbit (
-
zerol));
+ if (1.0L /
minus_
zerol < 0)
+ ASSERT (signbit (
minus_
zerol));
else
else
- ASSERT (!signbit (
-
zerol));
+ ASSERT (!signbit (
minus_
zerol));
/* Infinite values. */
ASSERT (!signbit (1.0L / 0.0L));
ASSERT (signbit (-1.0L / 0.0L));
/* Infinite values. */
ASSERT (!signbit (1.0L / 0.0L));
ASSERT (signbit (-1.0L / 0.0L));