Browse Source

test: remove isnan() unit tests because we can't rely on that function.

undefined
Sam Hocevar 11 years ago
parent
commit
66b7dd7198
2 changed files with 4 additions and 18 deletions
  1. +0
    -8
      test/unit/build.cpp
  2. +4
    -10
      test/unit/half.cpp

+ 0
- 8
test/unit/build.cpp View File

@@ -153,14 +153,6 @@ LOLUNIT_FIXTURE(BuildTest)


LOLUNIT_ASSERT_EQUAL(1.0, y); LOLUNIT_ASSERT_EQUAL(1.0, y);
} }

LOLUNIT_TEST(IsNaN)
{
union { float f; uint32_t x; } u;

u.x = 0x7fc00000u;
LOLUNIT_ASSERT(isnan(u.f));
}
}; };


} /* namespace lol */ } /* namespace lol */


+ 4
- 10
test/unit/half.cpp View File

@@ -159,19 +159,13 @@ LOLUNIT_FIXTURE(HalfTest)
for (uint32_t i = 0; i < 0x10000; i++) for (uint32_t i = 0; i < 0x10000; i++)
{ {
half h = half::makebits(i); half h = half::makebits(i);
if (h.is_nan())
continue;

float f = (float)h; float f = (float)h;
half g = (half)f; half g = (half)f;
LOLUNIT_SET_CONTEXT(i); LOLUNIT_SET_CONTEXT(i);
if (h.is_nan())
{
LOLUNIT_ASSERT(isnan(f));
LOLUNIT_ASSERT(g.is_nan());
}
else
{
LOLUNIT_ASSERT(!isnan(f));
LOLUNIT_ASSERT_EQUAL(g.bits, h.bits);
}
LOLUNIT_ASSERT_EQUAL(g.bits, h.bits);
} }
} }




Loading…
Cancel
Save