diff options
author | Max Horn | 2010-11-18 17:02:51 +0000 |
---|---|---|
committer | Max Horn | 2010-11-18 17:02:51 +0000 |
commit | 152e52d0156e443f8dc52bf2bddf9ef21a32f853 (patch) | |
tree | e8dd311aa6abd87be931a97beb9c417490067c72 /test/common | |
parent | b8f00267398d2a1722ed550beee8178bc2a9ac6f (diff) | |
download | scummvm-rg350-152e52d0156e443f8dc52bf2bddf9ef21a32f853.tar.gz scummvm-rg350-152e52d0156e443f8dc52bf2bddf9ef21a32f853.tar.bz2 scummvm-rg350-152e52d0156e443f8dc52bf2bddf9ef21a32f853.zip |
COMMON: Make implementation of Buffered*Stream classes internal
svn-id: r54326
Diffstat (limited to 'test/common')
-rw-r--r-- | test/common/bufferedreadstream.h | 8 | ||||
-rw-r--r-- | test/common/bufferedseekablereadstream.h | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/test/common/bufferedreadstream.h b/test/common/bufferedreadstream.h index 0b2cda696c..4238c1b42e 100644 --- a/test/common/bufferedreadstream.h +++ b/test/common/bufferedreadstream.h @@ -11,7 +11,7 @@ class BufferedReadStreamTestSuite : public CxxTest::TestSuite { // Use a buffer size of 4 -- note that 10 % 4 != 0, // so we test what happens if the cache can't be completely // refilled. - Common::BufferedReadStream srs(&ms, 4); + Common::ReadStream &srs = *Common::wrapBufferedReadStream(&ms, 4, DisposeAfterUse::NO); byte i, b; for (i = 0; i < 10; ++i) { @@ -26,13 +26,15 @@ class BufferedReadStreamTestSuite : public CxxTest::TestSuite { b = srs.readByte(); TS_ASSERT(srs.eos()); + + delete &srs; } void test_traverse2() { byte contents[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; Common::MemoryReadStream ms(contents, 9); - Common::BufferedReadStream brs(&ms, 4); + Common::ReadStream &brs = *Common::wrapBufferedReadStream(&ms, 4, DisposeAfterUse::NO); // Traverse the stream with reads of 2 bytes. The size is not // a multiple of 2, so we can test the final partial read. @@ -51,5 +53,7 @@ class BufferedReadStreamTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(n, 1); TS_ASSERT(brs.eos()); + + delete &brs; } }; diff --git a/test/common/bufferedseekablereadstream.h b/test/common/bufferedseekablereadstream.h index 74401ad202..d9b8e2f6a0 100644 --- a/test/common/bufferedseekablereadstream.h +++ b/test/common/bufferedseekablereadstream.h @@ -8,7 +8,8 @@ class BufferedSeekableReadStreamTestSuite : public CxxTest::TestSuite { byte contents[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; Common::MemoryReadStream ms(contents, 10); - Common::BufferedSeekableReadStream ssrs(&ms, 4); + Common::SeekableReadStream &ssrs + = *Common::wrapBufferedSeekableReadStream(&ms, 4, DisposeAfterUse::NO); byte i, b; for (i = 0; i < 10; ++i) { @@ -24,13 +25,16 @@ class BufferedSeekableReadStreamTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS((uint)0, ssrs.read(&b, 1)); TS_ASSERT(ssrs.eos()); + + delete &ssrs; } void test_seek() { byte contents[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; Common::MemoryReadStream ms(contents, 10); - Common::BufferedSeekableReadStream ssrs(&ms, 4); + Common::SeekableReadStream &ssrs + = *Common::wrapBufferedSeekableReadStream(&ms, 4, DisposeAfterUse::NO); byte b; TS_ASSERT_EQUALS(ssrs.pos(), 0); @@ -66,5 +70,7 @@ class BufferedSeekableReadStreamTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(ssrs.pos(), 2); b = ssrs.readByte(); TS_ASSERT_EQUALS(b, 2); + + delete &ssrs; } }; |