diff options
author | Johannes Schickel | 2010-02-03 16:02:04 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-02-03 16:02:04 +0000 |
commit | 8fcaa28a7fa85ae5d9b2eb01e17931d3206ee56c (patch) | |
tree | 1965b423bcf8069819212d4a96ecfb61b4a5d7e9 /test | |
parent | 6312b690de2cdda07b158fcffab35c02afaae92b (diff) | |
download | scummvm-rg350-8fcaa28a7fa85ae5d9b2eb01e17931d3206ee56c.tar.gz scummvm-rg350-8fcaa28a7fa85ae5d9b2eb01e17931d3206ee56c.tar.bz2 scummvm-rg350-8fcaa28a7fa85ae5d9b2eb01e17931d3206ee56c.zip |
Test various sample rates with RawStream's getLength implementation (just in case...).
svn-id: r47860
Diffstat (limited to 'test')
-rw-r--r-- | test/sound/raw.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/sound/raw.h b/test/sound/raw.h index e764f03060..5c25d16548 100644 --- a/test/sound/raw.h +++ b/test/sound/raw.h @@ -226,11 +226,43 @@ public: } void test_length() { - const int sampleRate = 11025; + int sampleRate = 0; const int time = 4; Audio::SeekableAudioStream *s = 0; + // 11025 Hz tests + sampleRate = 11025; + 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; + + // 48000 Hz tests + sampleRate = 48000; + 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; + + // 11840 Hz tests + sampleRate = 11840; + 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; + + // 11111 Hz tests + sampleRate = 11111; s = createSineStream<int8>(sampleRate, time, 0, false); TS_ASSERT_EQUALS(s->getLength().totalNumberOfFrames(), sampleRate * time); delete s; |