Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make more libm tests condition exceptions tests with math-tests.h.
  • Loading branch information
Joseph Myers committed Jun 12, 2013
1 parent e0e50a0 commit 94f2c07
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 51 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
@@ -1,3 +1,15 @@
2013-06-12 Joseph Myers <joseph@codesourcery.com>

* math/bug-nextafter.c: Include <math-tests.h>.
(main): Only test for exceptions if EXCEPTION_TESTS is true for
the relevant type.
* math/bug-nexttoward.c: Include <math-tests.h>.
(main): Only test for exceptions if EXCEPTION_TESTS is true for
the relevant type.
* math/test-misc.c: Include <math-tests.h>.
(main): Only test for exceptions if EXCEPTION_TESTS is true for
the relevant type.

2013-06-12 Andreas Jaeger <aj@suse.de>

* po/ia.po: Update Interlingua translation from translation
Expand Down
49 changes: 25 additions & 24 deletions math/bug-nextafter.c
Expand Up @@ -3,6 +3,7 @@
#include <float.h>
#include <stdlib.h>
#include <stdio.h>
#include <math-tests.h>

#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
/* If there's no support for the exceptions this test is checking,
Expand All @@ -26,7 +27,7 @@ main (void)
puts ("nextafterf+ failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterf+ did not overflow");
++result;
Expand All @@ -37,7 +38,7 @@ main (void)
puts ("nextafterf- failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterf- did not overflow");
++result;
Expand All @@ -52,7 +53,7 @@ main (void)
puts ("nextafterf+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
Expand All @@ -65,7 +66,7 @@ main (void)
puts ("nextafterf- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
Expand All @@ -78,7 +79,7 @@ main (void)
puts ("nextafterf+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
Expand All @@ -89,7 +90,7 @@ main (void)
puts ("nextafterf+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
Expand All @@ -101,7 +102,7 @@ main (void)
puts ("nextafterf- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
Expand All @@ -112,7 +113,7 @@ main (void)
puts ("nextafterf- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
Expand All @@ -126,7 +127,7 @@ main (void)
puts ("nextafter+ failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafter+ did not overflow");
++result;
Expand All @@ -137,7 +138,7 @@ main (void)
puts ("nextafter failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafter- did not overflow");
++result;
Expand All @@ -152,7 +153,7 @@ main (void)
puts ("nextafter+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
Expand All @@ -165,7 +166,7 @@ main (void)
puts ("nextafter- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
Expand All @@ -178,7 +179,7 @@ main (void)
puts ("nextafter+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
Expand All @@ -189,7 +190,7 @@ main (void)
puts ("nextafter+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
Expand All @@ -201,7 +202,7 @@ main (void)
puts ("nextafter- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
Expand All @@ -212,7 +213,7 @@ main (void)
puts ("nextafter- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
Expand All @@ -227,7 +228,7 @@ main (void)
puts ("nextafterl+ failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterl+ did not overflow");
++result;
Expand All @@ -238,7 +239,7 @@ main (void)
puts ("nextafterl failed");
++result;
}
if (fetestexcept (FE_OVERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterl- did not overflow");
++result;
Expand All @@ -253,7 +254,7 @@ main (void)
puts ("nextafterl+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
Expand All @@ -266,7 +267,7 @@ main (void)
puts ("nextafterl- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
Expand All @@ -279,7 +280,7 @@ main (void)
puts ("nextafterl+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
Expand All @@ -290,7 +291,7 @@ main (void)
puts ("nextafterl+ failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
Expand All @@ -302,7 +303,7 @@ main (void)
puts ("nextafterl- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
Expand All @@ -313,7 +314,7 @@ main (void)
puts ("nextafterl- failed");
++result;
}
if (fetestexcept (FE_UNDERFLOW) == 0)
if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
Expand Down

0 comments on commit 94f2c07

Please sign in to comment.