aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkNxTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-07-13 12:06:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-13 12:06:33 -0700
commite20633ed26d211e8d2b4b407c7e968944c7e60bb (patch)
tree130677b72aa8f0cb13afc7f258e159cf69d1f9fb /tests/SkNxTest.cpp
parentcd8c499f2e5126a8b5edee09d0debd8d298210fd (diff)
Add a GM that reproduces layout test failures with my new xfermode code.
Inspired by https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/69169/layout-test-results/results.html I think the root cause is overflow. Also, adds tests for Sk16b::operator<(). It wasn't wrong, but it was suspect (used in all three of these xfermode implementations) and so it's best to have tests. BUG=skia: Review URL: https://codereview.chromium.org/1228393006
Diffstat (limited to 'tests/SkNxTest.cpp')
-rw-r--r--tests/SkNxTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 3719044025..58932148cb 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -133,11 +133,13 @@ DEF_TEST(SkNi, r) {
test_Ni<8, int>(r);
}
-DEF_TEST(SkNi_min, r) {
+DEF_TEST(SkNi_min_lt, r) {
// Exhaustively check the 8x8 bit space.
for (int a = 0; a < (1<<8); a++) {
for (int b = 0; b < (1<<8); b++) {
- REPORTER_ASSERT(r, Sk16b::Min(Sk16b(a), Sk16b(b)).kth<0>() == SkTMin(a, b));
+ Sk16b aw(a), bw(b);
+ REPORTER_ASSERT(r, Sk16b::Min(aw, bw).kth<0>() == SkTMin(a, b));
+ REPORTER_ASSERT(r, !(aw < bw).kth<0>() == !(a < b));
}}
// Exhausting the 16x16 bit space is kind of slow, so only do that in release builds.