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

Unified Diff: tests/FrontBufferedStreamTest.cpp

Issue 1747423002: Fix FrontBufferedStreamTest (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/FrontBufferedStreamTest.cpp
diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp
index e3df466fd309b0f2c98eabda0be634b1b50473bd..d2bb43ab3ccf7dbdc3ff3f05032d30b51cec0061 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<SkCodec> codec(SkCodec::NewFromStream(stream.detach()));
- REPORTER_ASSERT(reporter, !failingStream->readAfterEnd());
msarett 2016/03/01 21:14:25 We can't check readAfterEnd() here. The codec has
}
« 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