Index: tests/Sk4xTest.cpp |
diff --git a/tests/Sk4xTest.cpp b/tests/Sk4xTest.cpp |
index 23eaf6853e6bc7ddab62b44f1be51bd1b01f5a51..a7a3184d1ec075f2de48d80a224120e140b92ac1 100644 |
--- a/tests/Sk4xTest.cpp |
+++ b/tests/Sk4xTest.cpp |
@@ -77,7 +77,6 @@ DEF_TEST(Sk4x_Arith, r) { |
float third = 1.0f/3.0f; |
ASSERT_EQ(Sk4f(1*third, 0.5f, 0.6f, 2*third), Sk4f(1,2,3,4).divide(Sk4f(3,4,5,6))); |
- |
ASSERT_EQ(Sk4i(4,6,8,10), Sk4i(1,2,3,4).add(Sk4i(3,4,5,6))); |
ASSERT_EQ(Sk4i(-2,-2,-2,-2), Sk4i(1,2,3,4).subtract(Sk4i(3,4,5,6))); |
ASSERT_EQ(Sk4i(3,8,15,24), Sk4i(1,2,3,4).multiply(Sk4i(3,4,5,6))); |
@@ -91,11 +90,13 @@ DEF_TEST(Sk4x_Sqrt, r) { |
Sk4f squares(4, 16, 25, 121), |
roots(2, 4, 5, 11); |
// .sqrt() should be pretty precise. |
- ASSERT_EQ(roots, squares.sqrt()); |
+ Sk4f error = roots.subtract(squares.sqrt()); |
msarett
2015/03/04 20:27:30
I was forced to change this test. Two iteration s
|
+ REPORTER_ASSERT(r, error.greaterThanEqual(0.0f).allTrue()); |
+ REPORTER_ASSERT(r, error.lessThan(0.000001f).allTrue()); |
- // .rsqrt() isn't so precise, but should be pretty close. |
- Sk4f error = roots.subtract(squares.multiply(squares.rsqrt())); |
- REPORTER_ASSERT(r, error.greaterThan(0.0f).allTrue()); |
+ // .rsqrt() isn't so precise (for SSE), but should be pretty close. |
+ error = roots.subtract(squares.multiply(squares.rsqrt())); |
+ REPORTER_ASSERT(r, error.greaterThanEqual(0.0f).allTrue()); |
msarett
2015/03/04 20:27:30
I think this is a bug in the test.
|
REPORTER_ASSERT(r, error.lessThan(0.01f).allTrue()); |
} |