Fix FrontBufferedStreamTest
authormsarett <msarett@google.com>
Tue, 1 Mar 2016 21:29:15 +0000 (13:29 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 1 Mar 2016 21:29:15 +0000 (13:29 -0800)
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

index e3df466fd309b0f2c98eabda0be634b1b50473bd..d2bb43ab3ccf7dbdc3ff3f05032d30b51cec0061 100644 (file)
@@ -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<SkCodec> codec(SkCodec::NewFromStream(stream.detach()));
-    REPORTER_ASSERT(reporter, !failingStream->readAfterEnd());
 }