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

Unified Diff: tests/StreamTest.cpp

Issue 1080073002: early return from stream peek (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/StreamTest.cpp
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 776c2010145e15579064fb2431ee0b35b4097e89..3641f3b8241babe008b83b55b26bf2657139e044 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -259,6 +259,9 @@ DEF_TEST(StreamPeek, reporter) {
// Test an arbitrary file stream. file streams do not support peeking.
SkFILEStream fileStream(GetResourcePath("baby_tux.webp").c_str());
REPORTER_ASSERT(reporter, fileStream.isValid());
+ if (!fileStream.isValid()) {
+ return;
+ }
SkAutoMalloc storage(fileStream.getLength());
for (size_t i = 1; i < fileStream.getLength(); i++) {
REPORTER_ASSERT(reporter, !fileStream.peek(storage.get(), i));
« 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