diff options
author | caryclark <caryclark@google.com> | 2015-04-20 08:31:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-20 08:31:59 -0700 |
commit | 1049f1246e7be4ccb68001361efceb8933e6f81c (patch) | |
tree | 9c71ceb245856cbe2173913eaec3b0ebb490dd74 /tests/PathOpsExtendedTest.cpp | |
parent | 5c476fb2776639bdbf0e974dd38d1c5d4c4ff1aa (diff) |
Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops.
TBR=reed
BUG=skia:3588
Review URL: https://codereview.chromium.org/1037953004
Diffstat (limited to 'tests/PathOpsExtendedTest.cpp')
-rw-r--r-- | tests/PathOpsExtendedTest.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp index 5889ac428b..f303ad1f16 100644 --- a/tests/PathOpsExtendedTest.cpp +++ b/tests/PathOpsExtendedTest.cpp @@ -297,27 +297,27 @@ static void showPathOpPath(const char* testName, const SkPath& one, const SkPath const SkPath& a, const SkPath& b, const SkPath& scaledOne, const SkPath& scaledTwo, const SkPathOp shapeOp, const SkMatrix& scale) { SkASSERT((unsigned) shapeOp < SK_ARRAY_COUNT(opStrs)); - SkString defaultTestName; if (!testName) { - defaultTestName.printf("xOp%d%s", gTestNo, opSuffixes[shapeOp]); - testName = defaultTestName.c_str(); + testName = "xOp"; } - SkDebugf("static void %s(skiatest::Reporter* reporter, const char* filename) {\n", testName); + SkDebugf("static void %s%d%s(skiatest::Reporter* reporter, const char* filename) {\n", + testName, gTestNo, opSuffixes[shapeOp]); *gTestOp.append() = shapeOp; ++gTestNo; SkDebugf(" SkPath path, pathB;\n"); -#if 0 && DEBUG_SHOW_TEST_NAME SkPathOpsDebug::ShowOnePath(a, "path", false); SkPathOpsDebug::ShowOnePath(b, "pathB", false); -#endif SkDebugf(" testPathOp(reporter, path, pathB, %s, filename);\n", opStrs[shapeOp]); SkDebugf("}\n"); drawAsciiPaths(scaledOne, scaledTwo, true); } -void ShowTestArray() { +void ShowTestArray(const char* testName) { + if (!testName) { + testName = "xOp"; + } for (int x = gTestFirst; x < gTestNo; ++x) { - SkDebugf(" TEST(xOp%d%s),\n", x, opSuffixes[gTestOp[x - gTestFirst]]); + SkDebugf(" TEST(%s%d%s),\n", testName, x, opSuffixes[gTestOp[x - gTestFirst]]); } } @@ -548,17 +548,25 @@ bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath return innerPathOp(reporter, a, b, shapeOp, testName, false, checkFail); } +bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, + const SkPathOp shapeOp, const char* testName) { + return innerPathOp(reporter, a, b, shapeOp, testName, false, false); +} + bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const char* testName) { #if DEBUG_SHOW_TEST_NAME showName(a, b, shapeOp); #endif - SkPath out; + SkPath orig; + orig.lineTo(54, 43); + SkPath out = orig; if (Op(a, b, shapeOp, &out) ) { SkDebugf("%s test is expected to fail\n", __FUNCTION__); REPORTER_ASSERT(reporter, 0); return false; } + SkASSERT(out == orig); return true; } |