OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |