From 9de8fb9a675e3df7e15f153e7c880eaafdfc6af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 7 Jan 2017 18:53:47 +0100 Subject: [PATCH] Math: expect minor sRGB monotonicity test failure on Emscripten -O3 build. The debug output isn't even able to print the difference as it is differing *very* little. --- src/Magnum/Math/Test/ColorTest.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index bef29727e..0841ac155 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -634,7 +634,15 @@ void ColorTest::srgbMonotonic() { Color3 rgb = Color3::fromSrgb(Math::Vector3(testCaseRepeatId() + 1)); CORRADE_COMPARE_AS(rgb, rgbPrevious, Corrade::TestSuite::Compare::Greater); CORRADE_COMPARE_AS(rgb, Color3(0.0f), Corrade::TestSuite::Compare::GreaterOrEqual); - CORRADE_COMPARE_AS(rgb, Color3(1.0f), Corrade::TestSuite::Compare::LessOrEqual); + { + #ifdef CORRADE_TARGET_EMSCRIPTEN + CORRADE_EXPECT_FAIL_IF(testCaseRepeatId() == 65534 && !!(rgb > Color3(1.0f)), + "Some minor rounding error possibly due to some Esmcripten " + "optimizations. Happens only on larger optimization levels, not " + "on -O1."); + #endif + CORRADE_COMPARE_AS(rgb, Color3(1.0f), Corrade::TestSuite::Compare::LessOrEqual); + } } void ColorTest::srgbLiterals() {