From 30ac464d4845ef6566c436de9bc3404f097da942 Mon Sep 17 00:00:00 2001 From: caryclark Date: Tue, 14 Apr 2015 06:08:04 -0700 Subject: 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 --- tests/StreamTest.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/StreamTest.cpp') 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)); -- cgit v1.2.3