diff options
author | das <das@FreeBSD.org> | 2007-01-07 09:25:22 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2007-01-07 09:25:22 +0000 |
commit | 8fda45acaea62f5393add9399c4f2c50bb409ead (patch) | |
tree | 56e23de26b56d95f3119caa555b3aa727e4a9ecc /tools | |
parent | 3ef4cfecda8155c7c262ddbc3262504420742727 (diff) | |
download | FreeBSD-src-8fda45acaea62f5393add9399c4f2c50bb409ead.zip FreeBSD-src-8fda45acaea62f5393add9399c4f2c50bb409ead.tar.gz |
Fix a few of the tests so that correct implementations actually pass them.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/lib/msun/test-rem.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/regression/lib/msun/test-rem.c b/tools/regression/lib/msun/test-rem.c index 1d7729a..a4b09c9 100644 --- a/tools/regression/lib/msun/test-rem.c +++ b/tools/regression/lib/msun/test-rem.c @@ -100,11 +100,15 @@ test_invalid(double x, double y) assert(isnan(remainder(x, y))); assert(isnan(remquo(x, y, &q))); +#ifdef STRICT assert(q == 0xdeadbeef); +#endif assert(isnan(remainderf(x, y))); assert(isnan(remquof(x, y, &q))); +#ifdef STRICT assert(q == 0xdeadbeef); +#endif } /* 0x012345 ==> 0x01ffff */ @@ -123,9 +127,11 @@ testd(double x, double y, double expected_rem, int expected_quo) assert(remainder(x, y) == expected_rem); assert(remquo(x, y, &q) == expected_rem); assert((q & 0x7) == (expected_quo & 0x7)); - assert((q > 0) ^ !(expected_quo > 0)); - q = abs(q); - assert((q & mask(q)) == (abs(expected_quo) & mask(q))); + if (q != 0) { + assert((q > 0) ^ !(expected_quo > 0)); + q = abs(q); + assert(q == (abs(expected_quo) & mask(q))); + } } static void @@ -137,7 +143,9 @@ testf(float x, float y, float expected_rem, int expected_quo) assert(remainderf(x, y) == expected_rem); assert(remquof(x, y, &q) == expected_rem); assert((q & 0x7) == (expected_quo & 0x7)); - assert((q > 0) ^ !(expected_quo > 0)); - q = abs(q); - assert((q & mask(q)) == (abs(expected_quo) & mask(q))); + if (q != 0) { + assert((q > 0) ^ !(expected_quo > 0)); + q = abs(q); + assert((q & mask(q)) == (abs(expected_quo) & mask(q))); + } } |