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

Unified Diff: tests/SkNxTest.cpp

Issue 1590843003: add SkNx::abs(), for now only implemented for Sk4f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkTAbs Created 4 years, 11 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 | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkNxTest.cpp
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 754e9800b12963bbebf04de4239f985426cc8502..fcd113d44dfcdd4674fa3f0c120e461176bcd649 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -216,3 +216,11 @@ DEF_TEST(SkNx_cast, r) {
REPORTER_ASSERT(r, is.kth<2>() == 0);
REPORTER_ASSERT(r, is.kth<3>() == 1);
}
+
+DEF_TEST(SkNx_abs, r) {
+ auto fs = Sk4f(0.0f, -0.0f, 2.0f, -4.0f).abs();
+ REPORTER_ASSERT(r, fs.kth<0>() == 0.0f);
+ REPORTER_ASSERT(r, fs.kth<1>() == 0.0f);
+ REPORTER_ASSERT(r, fs.kth<2>() == 2.0f);
+ REPORTER_ASSERT(r, fs.kth<3>() == 4.0f);
+}
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698