Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Unified Diff: tests/Sk4xTest.cpp

Issue 1028743002: Allow negative error for Sk4f::sqrt() test. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Sk4xTest.cpp
diff --git a/tests/Sk4xTest.cpp b/tests/Sk4xTest.cpp
index cdd7d564883128647e7c9ef5de1a3a4e62ad6573..d7a016c3c2406a500579303916863e0551385e46 100644
--- a/tests/Sk4xTest.cpp
+++ b/tests/Sk4xTest.cpp
@@ -93,13 +93,13 @@ DEF_TEST(Sk4x_Sqrt, r) {
roots(2, 4, 5, 11);
// .sqrt() should be pretty precise.
Sk4f error = roots.subtract(squares.sqrt());
- REPORTER_ASSERT(r, error.greaterThanEqual(Sk4f(0.0f)).allTrue());
- REPORTER_ASSERT(r, error.lessThan(Sk4f(0.000001f)).allTrue());
+ REPORTER_ASSERT(r, (error > Sk4f(-0.000001f)).allTrue());
+ REPORTER_ASSERT(r, (error < Sk4f(+0.000001f)).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(Sk4f(0.0f)).allTrue());
- REPORTER_ASSERT(r, error.lessThan(Sk4f(0.01f)).allTrue());
+ REPORTER_ASSERT(r, (error > Sk4f(-0.01f)).allTrue());
+ REPORTER_ASSERT(r, (error < Sk4f(+0.01f)).allTrue());
}
DEF_TEST(Sk4x_Comparison, r) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698