|
|
|
|
@ -28,6 +28,7 @@ MathTest::MathTest() {
|
|
|
|
|
&MathTest::degrad, |
|
|
|
|
&MathTest::normalize, |
|
|
|
|
&MathTest::denormalize, |
|
|
|
|
&MathTest::clamp, |
|
|
|
|
&MathTest::pow, |
|
|
|
|
&MathTest::log); |
|
|
|
|
} |
|
|
|
|
@ -96,6 +97,12 @@ void MathTest::denormalize() {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MathTest::clamp() { |
|
|
|
|
CORRADE_COMPARE(Math::clamp(0.5f, -1.0f, 5.0f), 0.5f); |
|
|
|
|
CORRADE_COMPARE(Math::clamp(-1.6f, -1.0f, 5.0f), -1.0f); |
|
|
|
|
CORRADE_COMPARE(Math::clamp(9.5f, -1.0f, 5.0f), 5.0f); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MathTest::pow() { |
|
|
|
|
CORRADE_COMPARE(Math::pow<10>(2ul), 1024ul); |
|
|
|
|
CORRADE_COMPARE(Math::pow<0>(3ul), 1ul); |
|
|
|
|
|