From b9e56c1ee6c4c8ae0a2e9247e504d92de4a6bfaa Mon Sep 17 00:00:00 2001 From: msarett Date: Tue, 1 Mar 2016 13:29:15 -0800 Subject: [PATCH] Fix FrontBufferedStreamTest TBR=scroggo@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1747423002 Review URL: https://codereview.chromium.org/1747423002 --- tests/FrontBufferedStreamTest.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp index e3df466fd3..d2bb43ab3c 100644 --- a/tests/FrontBufferedStreamTest.cpp +++ b/tests/FrontBufferedStreamTest.cpp @@ -263,14 +263,11 @@ class FailingStream : public SkStream { public: FailingStream() : fAtEnd(false) - , fReadAfterEnd(false) {} + size_t read(void* buffer, size_t size) override { - if (fAtEnd) { - fReadAfterEnd = true; - } else { - fAtEnd = true; - } + SkASSERT(!fAtEnd); + fAtEnd = true; return 0; } @@ -278,12 +275,8 @@ public: return fAtEnd; } - bool readAfterEnd() const { - return fReadAfterEnd; - } private: bool fAtEnd; - bool fReadAfterEnd; }; DEF_TEST(ShortFrontBufferedStream, reporter) { @@ -293,5 +286,4 @@ DEF_TEST(ShortFrontBufferedStream, reporter) { // This will fail to create a codec. However, what we really want to test is that we // won't read past the end of the stream. SkAutoTDelete codec(SkCodec::NewFromStream(stream.detach())); - REPORTER_ASSERT(reporter, !failingStream->readAfterEnd()); }