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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/utils/SkParsePath.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkParsePath.h" 8 #include "SkParsePath.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 SkRect r; 56 SkRect r;
57 r.set(0, 0, 10, 10.5f); 57 r.set(0, 0, 10, 10.5f);
58 SkPath p; 58 SkPath p;
59 p.addRect(r); 59 p.addRect(r);
60 test_to_from(reporter, p); 60 test_to_from(reporter, p);
61 p.addOval(r); 61 p.addOval(r);
62 test_to_from(reporter, p); 62 test_to_from(reporter, p);
63 p.addRoundRect(r, 4, 4.5f); 63 p.addRoundRect(r, 4, 4.5f);
64 test_to_from(reporter, p); 64 test_to_from(reporter, p);
65 } 65 }
66
67 DEF_TEST(ParsePath_invalid, r) {
68 SkPath path;
69 // This is an invalid SVG string, but the test verifies that we do not
70 // crash.
71 bool success = SkParsePath::FromSVGString("M 5", &path);
72 REPORTER_ASSERT(r, !success);
73 }
OLDNEW
« 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