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

Unified Diff: tests/MatrixTest.cpp

Issue 1532963002: Make SkMatrix::get*Scale[s]() fail on NaN (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SK_WARN_UNUSED_RESULT Created 5 years 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/core/SkMatrix.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MatrixTest.cpp
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index edeb649a66ce07f518ca8d4287fcf93e7c777e5b..f08613f22e52db17d036e485d67ff741de121a37 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();
« no previous file with comments | « src/core/SkMatrix.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698