From f470b4369cb0af1347eadd8117017f2089e332c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 20 Aug 2017 19:04:47 +0200 Subject: [PATCH] Math/Algorithms: update XFAIL for WebAssembly. --- src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp b/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp index 616acb362..bfda11bfb 100644 --- a/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp @@ -91,13 +91,15 @@ void KahanSumTest::floats() { Iterator end{1.0f, 100000000}; CORRADE_COMPARE(kahanSum(begin, end), 1.0e8f); + float sum = std::accumulate(begin, end, 0.0f); { #ifdef CORRADE_TARGET_EMSCRIPTEN - /* Last tested: emscripten 1.37.1 */ - CORRADE_EXPECT_FAIL("Gives the same result as kahanSum(), might be " - "because doubles are used internally."); + /* Last tested: emscripten 1.37.18, asm.js. Wasm gives proper result. */ + CORRADE_EXPECT_FAIL_IF(sum == 1.0e8f, + "Gives the same result as kahanSum(), might be because doubles " + "are used internally on asm.js."); #endif - CORRADE_COMPARE(std::accumulate(begin, end, 0.0f), 1.6777216e7f); + CORRADE_COMPARE(sum, 1.6777216e7f); } } @@ -132,10 +134,10 @@ void KahanSumTest::iterative() { } { #ifdef CORRADE_TARGET_EMSCRIPTEN /* Last tested: emscripten 1.37.1 */ - CORRADE_EXPECT_FAIL_IF(sumKahan == 1.0e8f, + CORRADE_EXPECT_FAIL_IF(sum == 1.0e8f, "Gives the same result as kahanSum(), might be because doubles are " - "used internally. Happens only on larger optimization levels, not " - "on -O1."); + "used internally on asm.js. Happens only on larger optimization " + "levels, not on -O1."); #endif CORRADE_COMPARE(sum, 1.6777216e7f); }