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

Unified Diff: tests/PictureTest.cpp

Issue 18904003: Increase safety of PictureTest (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: After testing provide an actual fix Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 49bc57b1af29960e5cafa0cc709440d2171f0559..99082ea35203d50c7669983c1cdcc75a148c5760 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -188,10 +188,10 @@ static void test_gatherpixelrefs(skiatest::Reporter* reporter) {
r.set(2, 2, W - 2, H - 2);
r.offset(pos[i].fX, pos[i].fY);
SkAutoDataUnref data(SkPictureUtils::GatherPixelRefs(pic, r));
- REPORTER_ASSERT(reporter, data);
- int count = data->size() / sizeof(SkPixelRef*);
+ REPORTER_ASSERT(reporter, NULL != data);
reed1 2013/07/09 14:28:14 If we're going to do nothing if data is NULL, it t
tomhudson 2013/07/09 14:57:37 Done.
+ int count = data ? data->size() / sizeof(SkPixelRef*) : 0;
REPORTER_ASSERT(reporter, 1 == count);
- REPORTER_ASSERT(reporter, *(SkPixelRef**)data->data() == refs[i]);
+ REPORTER_ASSERT(reporter, data && *(SkPixelRef**)data->data() == refs[i]);
}
// Test a bunch of random (mostly) rects, and compare the gather results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698