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

Unified Diff: tests/PathTest.cpp

Issue 732643002: Don't pass null to memcmp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify check Created 6 years, 1 month 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/core/SkPathRef.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index bc3a3d7bdb5874ffbd3156ae309d73f9562b8da3..94b91d261be37a3396f184f28202de836dfbb26b 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -3435,7 +3435,11 @@ static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool
path.dump(&wStream, force, dumpAsHex);
SkAutoDataUnref data(wStream.copyToData());
REPORTER_ASSERT(reporter, data->size() == strlen(str));
- REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str)));
+ if (strlen(str) > 0) {
+ REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str)));
+ } else {
+ REPORTER_ASSERT(reporter, data->data() == NULL || !memcmp(data->data(), str, strlen(str)));
+ }
}
static void test_dump(skiatest::Reporter* reporter) {
« no previous file with comments | « src/core/SkPathRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698