aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsOpTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2014-09-08 10:25:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-08 10:25:38 -0700
commit361b8b088589748e4b29895a4ebc5316e881e219 (patch)
tree8363e5d940b956d827e6ba5a62a627a185b72c8a /tests/PathOpsOpTest.cpp
parent224310941e01b62b9b45db8656261a3d936cecf5 (diff)
fail when coincidence is too far apart
TBR= BUG=410552 Author: caryclark@google.com Review URL: https://codereview.chromium.org/556433002
Diffstat (limited to 'tests/PathOpsOpTest.cpp')
-rw-r--r--tests/PathOpsOpTest.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 2c67449950..866b5b216c 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -3771,7 +3771,52 @@ static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) {
testPathFailOp(reporter, path, pathB, kUnion_PathOp, filename);
}
+// m 100,0 60,170 -160,-110 200,0 -170,11000000000 z
+static void fuzz433(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path1, path2;
+ path1.moveTo(100,0);
+ path1.lineTo(60,170);
+ path1.lineTo(-160,-110);
+ path1.lineTo(200,0);
+ path1.lineTo(-170,11000000000.0f);
+ path1.close();
+
+ path2.moveTo(100 + 20,0 + 20);
+ path2.lineTo(60 + 20,170 + 20);
+ path2.lineTo(-160 + 20,-110 + 20);
+ path2.lineTo(200 + 20,0 + 20);
+ path2.lineTo(-170 + 20,11000000000.0f + 20);
+ path2.close();
+
+ testPathFailOp(reporter, path1, path2, kIntersect_PathOp, filename);
+}
+
+static void fuzz433b(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path1, path2;
+ path1.setFillType(SkPath::kEvenOdd_FillType);
+ path1.moveTo(140, 40);
+ path1.lineTo(200, 210);
+ path1.lineTo(40, 100);
+ path1.lineTo(240, 100);
+ path1.lineTo(70, 1.1e+10f);
+ path1.lineTo(140, 40);
+ path1.close();
+
+ path1.setFillType(SkPath::kWinding_FillType);
+ path2.moveTo(190, 60);
+ path2.lineTo(250, 230);
+ path2.lineTo(90, 120);
+ path2.lineTo(290, 120);
+ path2.lineTo(120, 1.1e+10f);
+ path2.lineTo(190, 60);
+ path2.close();
+
+ testPathFailOp(reporter, path1, path2, kUnion_PathOp, filename);
+}
+
static struct TestDesc failTests[] = {
+ TEST(fuzz433b),
+ TEST(fuzz433),
TEST(bufferOverflow),
};