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

Unified Diff: tests/ParsePathTest.cpp

Issue 1675053002: test parsepath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: unused variable Created 4 years, 10 months 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') | tools/random_parse_path.h » ('j') | 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 561eed04b55af719bf13c9d3c219d4397e2b0c7b..fa239c2b3d44c79bce7f9d0c2e0cbf39a8d3c487 100644
--- a/tests/ParsePathTest.cpp
+++ b/tests/ParsePathTest.cpp
@@ -71,3 +71,20 @@ DEF_TEST(ParsePath_invalid, r) {
bool success = SkParsePath::FromSVGString("M 5", &path);
REPORTER_ASSERT(r, !success);
}
+
+#include "random_parse_path.h"
+#include "SkRandom.h"
+
+DEF_TEST(ParsePathRandom, r) {
+ SkRandom rand;
+ for (int index = 0; index < 1000; ++index) {
+ SkPath path, path2;
+ SkString spec;
+ uint32_t count = rand.nextRangeU(0, 10);
+ for (uint32_t i = 0; i < count; ++i) {
+ spec.append(MakeRandomParsePathPiece(&rand));
+ }
+ bool success = SkParsePath::FromSVGString(spec.c_str(), &path);
+ REPORTER_ASSERT(r, success);
+ }
+}
« no previous file with comments | « src/utils/SkParsePath.cpp ('k') | tools/random_parse_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698