aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-09-08 15:00:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-08 19:56:38 +0000
commit1170a553be35920fe45d6a454a27d21167060977 (patch)
treed293631bb26ce038885723d75238c98658a62439 /tests/PathTest.cpp
parent900cd05037739eac6fd7bb8611ac489bb5ad305e (diff)
Don't allow iteration through non-finite points.
Added a unit test too. BUG=chromium:756563 Change-Id: Ic77a89b4a98d1a553877af9807a3d3bdcd077bb9 Reviewed-on: https://skia-review.googlesource.com/44420 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r--tests/PathTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index bdd15fbfb3..77f47bed30 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -4911,3 +4911,18 @@ DEF_TEST(PathRefSerialization, reporter) {
REPORTER_ASSERT(reporter, !bytesRead);
}
}
+
+DEF_TEST(NonFinitePathIteration, reporter) {
+ SkPath path;
+ path.moveTo(SK_ScalarInfinity, SK_ScalarInfinity);
+
+ int verbs = 0;
+
+ SkPath::RawIter iter(path);
+ SkPoint pts[4];
+ while (iter.next(pts) != SkPath::kDone_Verb) {
+ verbs++;
+ }
+
+ REPORTER_ASSERT(reporter, verbs == 0);
+}