aboutsummaryrefslogtreecommitdiff
path: root/tests/ParsePathTest.cpp
diff options
context:
space:
mode:
authorscroggo <scroggo@google.com>2015-12-11 09:49:57 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-11 09:49:57 -0800
commit28e80f4013d90a0da45d01533c16a612bfdb0a6c (patch)
tree05e28646e9852ffecacf8fc622bf54a38d1e89c8 /tests/ParsePathTest.cpp
parent46646506f1c95739998136472727d06760b75cf6 (diff)
Fix a crash in SkParsePath::FromSVGString
BUG=skia:3491 Review URL: https://codereview.chromium.org/1515193002
Diffstat (limited to 'tests/ParsePathTest.cpp')
-rw-r--r--tests/ParsePathTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ParsePathTest.cpp b/tests/ParsePathTest.cpp
index d2059d6dd0..561eed04b5 100644
--- a/tests/ParsePathTest.cpp
+++ b/tests/ParsePathTest.cpp
@@ -63,3 +63,11 @@ DEF_TEST(ParsePath, reporter) {
p.addRoundRect(r, 4, 4.5f);
test_to_from(reporter, p);
}
+
+DEF_TEST(ParsePath_invalid, r) {
+ SkPath path;
+ // This is an invalid SVG string, but the test verifies that we do not
+ // crash.
+ bool success = SkParsePath::FromSVGString("M 5", &path);
+ REPORTER_ASSERT(r, !success);
+}