diff options
author | Cary Clark <caryclark@skia.org> | 2018-04-13 07:07:04 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-13 14:01:32 +0000 |
commit | d4228473a552dc2e683182c47a957977f53df581 (patch) | |
tree | d87c15c4b2888c410e9d0ed74fe05a71de4ed78d /tests/PathTest.cpp | |
parent | d1999cacd8a1b0c29288f08cea9c0c812c8de9ad (diff) |
path is rect bug number nine
This variation exploits a sequence which uses a zero
length line to note that lines have been recorded, but
no rectangle edge has been encountered.
R=robertphillips@google.com
Docs-Preview: https://skia.org/?cl=121282
Bug: 824145,skia:7792
Change-Id: I652e9482b2867c3d7da30d5f5df2aecbfd0d716d
Reviewed-on: https://skia-review.googlesource.com/121282
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r-- | tests/PathTest.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index b96b93ccfe..8ac6e02e17 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4930,7 +4930,7 @@ DEF_TEST(Path_isRect, reporter) { } return path; }; - // isolated from skbug.com/7792 bug description + // isolated from skbug.com/7792 (bug description) SkRect rect; SkPoint points[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} }; SkPath path = makePath(points, SK_ARRAY_COUNT(points), false); @@ -4938,17 +4938,17 @@ DEF_TEST(Path_isRect, reporter) { SkRect compare; compare.set(&points[1], SK_ARRAY_COUNT(points) - 1); REPORTER_ASSERT(reporter, rect == compare); - // isolated from skbug.com/7792 comment 3 + // isolated from skbug.com/7792#c3 SkPoint points3[] = { {75, 50}, {100, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 50} }; path = makePath(points3, SK_ARRAY_COUNT(points3), true); REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr)); - // isolated from skbug.com/7792 comment 9 + // isolated from skbug.com/7792#c9 SkPoint points9[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} }; path = makePath(points9, SK_ARRAY_COUNT(points9), true); REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr)); compare.set(&points9[1], SK_ARRAY_COUNT(points9) - 1); REPORTER_ASSERT(reporter, rect == compare); - // isolated from skbug.com/7792 comment 11 + // isolated from skbug.com/7792#c11 SkPath::Verb verbs11[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb }; SkPoint points11[] = { {75, 150}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 150} }; @@ -4956,7 +4956,7 @@ DEF_TEST(Path_isRect, reporter) { REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr)); compare.set(&points11[0], SK_ARRAY_COUNT(points11)); REPORTER_ASSERT(reporter, rect == compare); - // isolated from skbug.com/7792 comment 14 + // isolated from skbug.com/7792#c14 SkPath::Verb verbs14[] = { SkPath::kMove_Verb, SkPath::kMove_Verb, SkPath::kMove_Verb, SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kClose_Verb, @@ -4965,7 +4965,7 @@ DEF_TEST(Path_isRect, reporter) { {150, 75}, {150, 150}, {75, 150}, {75, 75}, {0, 0} }; path = makePath2(points14, verbs14, SK_ARRAY_COUNT(verbs14)); REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr)); - // isolated from skbug.com/7792 comment 15 + // isolated from skbug.com/7792#c15 SkPath::Verb verbs15[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb }; SkPoint points15[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {250, 75} }; @@ -4973,11 +4973,11 @@ DEF_TEST(Path_isRect, reporter) { REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr)); compare.set(&points15[0], SK_ARRAY_COUNT(points15) - 1); REPORTER_ASSERT(reporter, rect == compare); - // isolated from skbug.com/7792 comment 17 + // isolated from skbug.com/7792#c17 SkPoint points17[] = { {75, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 10} }; path = makePath(points17, SK_ARRAY_COUNT(points17), true); REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr)); - // isolated from skbug.com/7792 comment 19 + // isolated from skbug.com/7792#c19 SkPath::Verb verbs19[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kClose_Verb, SkPath::kMove_Verb, @@ -4986,4 +4986,14 @@ DEF_TEST(Path_isRect, reporter) { {75, 150}, {10, 10}, {30, 10}, {10, 30} }; path = makePath2(points19, verbs19, SK_ARRAY_COUNT(verbs19)); REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr)); + // isolated from skbug.com/7792#c23 + SkPath::Verb verbs23[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb, + SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb, + SkPath::kLine_Verb, SkPath::kClose_Verb }; + SkPoint points23[] = { {75, 75}, {75, 75}, {75, 75}, {75, 75}, {150, 75}, {150, 150}, + {75, 150} }; + path = makePath2(points23, verbs23, SK_ARRAY_COUNT(verbs23)); + REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr)); + compare.set(&points23[0], SK_ARRAY_COUNT(points23)); + REPORTER_ASSERT(reporter, rect == compare); } |