diff options
author | Johannes Schickel | 2010-02-03 15:45:29 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-02-03 15:45:29 +0000 |
commit | 2cb82808ebb8b7b0c938cc20d5b9446182177459 (patch) | |
tree | 38db153dbed6e635ee1e01d4bff7c57a144645a0 | |
parent | e9f831c1dabddb0ed700f0733313083dd8004564 (diff) | |
download | scummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.tar.gz scummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.tar.bz2 scummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.zip |
Add unit test for RawStream::getLength.
svn-id: r47858
-rw-r--r-- | test/sound/raw.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/sound/raw.h b/test/sound/raw.h index caeb79b7df..e764f03060 100644 --- a/test/sound/raw.h +++ b/test/sound/raw.h @@ -224,4 +224,19 @@ public: delete[] buffer; delete s; } + + void test_length() { + const int sampleRate = 11025; + const int time = 4; + + Audio::SeekableAudioStream *s = 0; + + s = createSineStream<int8>(sampleRate, time, 0, false); + TS_ASSERT_EQUALS(s->getLength().totalNumberOfFrames(), sampleRate * time); + delete s; + + s = createSineStream<uint16>(sampleRate, time, 0, false); + TS_ASSERT_EQUALS(s->getLength().totalNumberOfFrames(), sampleRate * time); + delete s; + } }; |