diff options
author | 2013-04-26 19:51:16 +0000 | |
---|---|---|
committer | 2013-04-26 19:51:16 +0000 | |
commit | 66560ca776773858abfffd59974eac32c942acc3 (patch) | |
tree | 16902f88fd485608a6d7310c634d154d17ee2f4b /tests/PathOpsExtendedTest.cpp | |
parent | 0cc99cf793d2de0523461a2cef1af2a62f4a1695 (diff) |
path ops -- handle non-finite numbers
Op() and Simplify() do nothing if the input
is non-finite. Add code and tests.
Review URL: https://codereview.chromium.org/14407006
git-svn-id: http://skia.googlecode.com/svn/trunk@8882 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PathOpsExtendedTest.cpp')
-rw-r--r-- | tests/PathOpsExtendedTest.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp index 4626454ac1..8d7ca289b9 100644 --- a/tests/PathOpsExtendedTest.cpp +++ b/tests/PathOpsExtendedTest.cpp @@ -449,7 +449,11 @@ bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& st if (gShowPath) { showPath(path); } - Simplify(path, &out); + if (!Simplify(path, &out)) { + SkDebugf("%s did not expect failure\n", __FUNCTION__); + REPORTER_ASSERT(state.fReporter, 0); + return false; + } if (!gComparePaths) { return true; } @@ -478,7 +482,11 @@ bool testSimplify(skiatest::Reporter* reporter, const SkPath& path) { showPathData(path); #endif SkPath out; - Simplify(path, &out); + if (!Simplify(path, &out)) { + SkDebugf("%s did not expect failure\n", __FUNCTION__); + REPORTER_ASSERT(reporter, 0); + return false; + } SkBitmap bitmap; int result = comparePaths(reporter, path, out, bitmap); if (result && gPathStrAssert) { @@ -496,7 +504,11 @@ bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, showPathData(b); #endif SkPath out; - Op(a, b, shapeOp, &out); + if (!Op(a, b, shapeOp, &out) ) { + SkDebugf("%s did not expect failure\n", __FUNCTION__); + REPORTER_ASSERT(reporter, 0); + return false; + } SkPath pathOut, scaledPathOut; SkRegion rgnA, rgnB, openClip, rgnOut; openClip.setRect(-16000, -16000, 16000, 16000); |