Sfoglia il codice sorgente

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

undefined
Sam Hocevar 11 anni fa
parent
commit
66b7dd7198
2 ha cambiato i file con 4 aggiunte e 18 eliminazioni
  1. +0
    -8
      test/unit/build.cpp
  2. +4
    -10
      test/unit/half.cpp

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

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

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 */


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

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

float f = (float)h;
half g = (half)f;
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);
}
}



Caricamento…
Annulla
Salva