diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SkNxTest.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp index bcf2a71658..933a5fc877 100644 --- a/tests/SkNxTest.cpp +++ b/tests/SkNxTest.cpp @@ -467,7 +467,8 @@ DEF_TEST(Sk2f_Store4, r) { Sk2f p1{1, 5}; Sk2f p2{2, 6}; Sk2f p3{3, 7}; - float dst[8]; + + float dst[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; Sk2f::Store4(dst, p0, p1, p2, p3); REPORTER_ASSERT(r, dst[0] == 0); REPORTER_ASSERT(r, dst[1] == 1); @@ -477,6 +478,19 @@ DEF_TEST(Sk2f_Store4, r) { REPORTER_ASSERT(r, dst[5] == 5); REPORTER_ASSERT(r, dst[6] == 6); REPORTER_ASSERT(r, dst[7] == 7); + + // Ensure transposing to Sk4f works. + Sk4f dst4f[2] = {{-1, -1, -1, -1}, {-1, -1, -1, -1}}; + Sk2f::Store4(dst4f, p0, p1, p2, p3); + REPORTER_ASSERT(r, dst4f[0][0] == 0); + REPORTER_ASSERT(r, dst4f[0][1] == 1); + REPORTER_ASSERT(r, dst4f[0][2] == 2); + REPORTER_ASSERT(r, dst4f[0][3] == 3); + REPORTER_ASSERT(r, dst4f[1][0] == 4); + REPORTER_ASSERT(r, dst4f[1][1] == 5); + REPORTER_ASSERT(r, dst4f[1][2] == 6); + REPORTER_ASSERT(r, dst4f[1][3] == 7); + } DEF_TEST(Sk4f_minmax, r) { |