projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dprintf-posix: Check against memory leak fixed on 2009-12-15.
[gnulib.git]
/
tests
/
test-ceilf1.c
diff --git
a/tests/test-ceilf1.c
b/tests/test-ceilf1.c
index
e2a04a0
..
3241936
100644
(file)
--- a/
tests/test-ceilf1.c
+++ b/
tests/test-ceilf1.c
@@
-23,26
+23,31
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include "isnanf.h"
+#include "isnanf
-nolibm
.h"
#include "nan.h"
#define ASSERT(expr) \
#include "nan.h"
#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
+ do
\
+ {
\
+ if (!(expr))
\
+ {
\
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- abort (); \
- } \
- } \
+ fflush (stderr); \
+ abort (); \
+ } \
+ } \
while (0)
while (0)
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
+ So we use -zero instead. */
+float zero = 0.0f;
+
int
main ()
{
/* Zero. */
ASSERT (ceilf (0.0f) == 0.0f);
int
main ()
{
/* Zero. */
ASSERT (ceilf (0.0f) == 0.0f);
- ASSERT (ceilf (-
0.0f
) == 0.0f);
+ ASSERT (ceilf (-
zero
) == 0.0f);
/* Positive numbers. */
ASSERT (ceilf (0.3f) == 1.0f);
ASSERT (ceilf (0.7f) == 1.0f);
/* Positive numbers. */
ASSERT (ceilf (0.3f) == 1.0f);
ASSERT (ceilf (0.7f) == 1.0f);