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

Unified Diff: tests/ParsePathTest.cpp

Issue 1515193002: Fix a crash in SkParsePath::FromSVGString (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years 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 | « src/utils/SkParsePath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ParsePathTest.cpp
diff --git a/tests/ParsePathTest.cpp b/tests/ParsePathTest.cpp
index d2059d6dd0ec31ef0b4422c0ae830932540a0b1f..561eed04b55af719bf13c9d3c219d4397e2b0c7b 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);
+}
« no previous file with comments | « src/utils/SkParsePath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698