mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 22:07:34 +00:00
Add test for rewind functionality of RawStream.
svn-id: r47856
This commit is contained in:
parent
6b2e9be345
commit
274f6e5033
@ -164,4 +164,23 @@ public:
|
||||
delete[] buffer;
|
||||
delete s;
|
||||
}
|
||||
|
||||
void test_rewind() {
|
||||
const int sampleRate = 11025;
|
||||
const int time = 2;
|
||||
Audio::SeekableAudioStream *s = createSineStream<int8>(sampleRate, time, 0, false);
|
||||
int16 *buffer = new int16[sampleRate * time];
|
||||
|
||||
TS_ASSERT_EQUALS(s->readBuffer(buffer, sampleRate * time), sampleRate * time);
|
||||
TS_ASSERT_EQUALS(s->endOfData(), true);
|
||||
|
||||
s->rewind();
|
||||
TS_ASSERT_EQUALS(s->endOfData(), false);
|
||||
|
||||
TS_ASSERT_EQUALS(s->readBuffer(buffer, sampleRate * time), sampleRate * time);
|
||||
TS_ASSERT_EQUALS(s->endOfData(), true);
|
||||
|
||||
delete[] buffer;
|
||||
delete s;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user