aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/StreamTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-04-14 06:08:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-14 06:08:04 -0700
commit30ac464d4845ef6566c436de9bc3404f097da942 (patch)
tree2063bceb4aad1b5d195f85ac4ebbdd08562bb53f /tests/StreamTest.cpp
parent164d5b09b79e4794911a5a4ffb02f4a12f1f0c94 (diff)
early return from stream peek
Don't assert if resources are missing R=scroggo@google.com BUG=skia:3719 Review URL: https://codereview.chromium.org/1080073002
Diffstat (limited to 'tests/StreamTest.cpp')
-rw-r--r--tests/StreamTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 776c201014..3641f3b824 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));