Browse Source

Math: don't depend on char signedness in test.

Hopefully that was only in the test.
pull/120/head
Vladimír Vondruš 11 years ago
parent
commit
e6567af364
  1. 8
      src/Magnum/Math/Test/FunctionsTest.cpp

8
src/Magnum/Math/Test/FunctionsTest.cpp

@ -414,7 +414,13 @@ void FunctionsTest::renormalizeSinged() {
}
void FunctionsTest::normalizeTypeDeduction() {
CORRADE_COMPARE(Math::normalize<Float>('\x7F'), 1.0f);
if(std::is_signed<char>::value)
CORRADE_COMPARE(Math::normalize<Float>('\x7F'), 1.0f);
else {
/* Raspberry Pi `char` is unsigned (huh) */
CORRADE_VERIFY(std::is_unsigned<char>::value);
CORRADE_COMPARE(Math::normalize<Float>('\x7F'), 0.498039f);
}
CORRADE_COMPARE((Math::normalize<Float, Byte>('\x7F')), 1.0f);
}

Loading…
Cancel
Save