diff options
author | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
commit | c8eeae8d4dffa5849a23cf963884027a7789504b (patch) | |
tree | 1f2a0de23851cb7e7d1d77114c8379aa27f4fb85 /test/common/seekablesubreadstream.h | |
parent | fbfe30bf861af9b83325e0c7fecd4b0a68da5af9 (diff) | |
download | scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.gz scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.bz2 scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.zip |
Big patch changing semantics of ReadStream::eos():
eos() now only returns true _after_ trying to read past the end of the stream.
This has a large potential for regressions. Please test!
svn-id: r34549
Diffstat (limited to 'test/common/seekablesubreadstream.h')
-rw-r--r-- | test/common/seekablesubreadstream.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/common/seekablesubreadstream.h b/test/common/seekablesubreadstream.h index 4e517093a5..24df380a60 100644 --- a/test/common/seekablesubreadstream.h +++ b/test/common/seekablesubreadstream.h @@ -23,6 +23,8 @@ class SeekableSubReadStreamTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS( i, b ); } + TS_ASSERT( !ssrs.eos() ); + TS_ASSERT( 0 == ssrs.read(&b, 1) ); TS_ASSERT( ssrs.eos() ); } @@ -52,9 +54,12 @@ class SeekableSubReadStreamTestSuite : public CxxTest::TestSuite { ssrs.seek(0, SEEK_END); TS_ASSERT_EQUALS( ssrs.pos(), (uint32)8 ); + TS_ASSERT( !ssrs.eos() ); + b = ssrs.readByte(); TS_ASSERT( ssrs.eos() ); ssrs.seek(3, SEEK_END); + TS_ASSERT( !ssrs.eos() ); TS_ASSERT_EQUALS( ssrs.pos(), (uint32)5 ); b = ssrs.readByte(); TS_ASSERT_EQUALS( b, 6 ); |