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

Unified Diff: tests/PathOpsExtendedTest.cpp

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging Created 5 years, 8 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 | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsFuzz763Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsExtendedTest.cpp
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index 5889ac428b5c16d943608fa5eb4d9f825c8dbed8..f303ad1f16b9b509415547bd6f97d11fa22f9a28 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;
}
« no previous file with comments | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsFuzz763Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698