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

Unified Diff: tests/PictureTest.cpp

Issue 18904003: Increase safety of PictureTest (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: use if() instead of lots of && in asserts 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..1827fdcb5a28ceb0a33541825c58a0fe57914790 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -189,9 +189,11 @@ static void test_gatherpixelrefs(skiatest::Reporter* reporter) {
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, 1 == count);
- REPORTER_ASSERT(reporter, *(SkPixelRef**)data->data() == refs[i]);
+ if (data) {
+ int count = data->size() / sizeof(SkPixelRef*);
+ REPORTER_ASSERT(reporter, 1 == count);
+ REPORTER_ASSERT(reporter, *(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