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

Unified Diff: tests/MatrixTest.cpp

Issue 1188433011: Added check for ill-conditioned invert (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address further code review comments (always perform exhaustive check) Created 5 years, 6 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/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 72e0dcc0214be24967c4f65ef0b78557eae0a2d5..2296b8f2b526495100b0fc0147b2de4fef683e61 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -838,6 +838,13 @@ DEF_TEST(Matrix, reporter) {
REPORTER_ASSERT(reporter, !mat.invert(NULL));
REPORTER_ASSERT(reporter, !mat.invert(&inverse));
+ // Inverting this matrix results in a non-finite matrix
+ mat.setAll(0.0f, 1.0f, 2.0f,
+ 0.0f, 1.0f, -3.40277175e+38f,
+ 1.00003040f, 1.0f, 0.0f);
+ REPORTER_ASSERT(reporter, !mat.invert(NULL));
+ REPORTER_ASSERT(reporter, !mat.invert(&inverse));
+
// rectStaysRect test
{
static const struct {
« 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