aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/MatrixTest.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-12-17 15:33:13 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-17 15:33:13 -0800
commitef2c7c705748e4c563c468f667dae7a9a38ffabc (patch)
tree3c001e7b92a3c609d105cc91fdcf2a83d9939841 /tests/MatrixTest.cpp
parentdafd044e4aea529f88d899247678d4549f776388 (diff)
Make SkMatrix::get*Scale[s]() fail on NaN
Diffstat (limited to 'tests/MatrixTest.cpp')
-rw-r--r--tests/MatrixTest.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index edeb649a66..f08613f22e 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -205,11 +205,18 @@ static void test_matrix_min_max_scale(skiatest::Reporter* reporter) {
perspX.setPerspX(SK_Scalar1 / 1000);
REPORTER_ASSERT(reporter, -SK_Scalar1 == perspX.getMinScale());
REPORTER_ASSERT(reporter, -SK_Scalar1 == perspX.getMaxScale());
- // Verify that getMinMaxScales() doesn't update the scales array on failure.
- scales[0] = -5;
- scales[1] = -5;
success = perspX.getMinMaxScales(scales);
- REPORTER_ASSERT(reporter, !success && -5 * SK_Scalar1 == scales[0] && -5 * SK_Scalar1 == scales[1]);
+ REPORTER_ASSERT(reporter, !success);
+
+ // skbug.com/4718
+ SkMatrix big;
+ big.setAll(2.39394089e+36f, 8.85347779e+36f, 9.26526204e+36f,
+ 3.9159619e+36f, 1.44823453e+37f, 1.51559342e+37f,
+ 0.f, 0.f, 1.f);
+ REPORTER_ASSERT(reporter, -SK_Scalar1 == perspX.getMinScale());
+ REPORTER_ASSERT(reporter, -SK_Scalar1 == perspX.getMaxScale());
+ success = big.getMinMaxScales(scales);
+ REPORTER_ASSERT(reporter, !success);
SkMatrix perspY;
perspY.reset();