aboutsummaryrefslogtreecommitdiff
path: root/test/sound/raw.h
diff options
context:
space:
mode:
authorJohannes Schickel2010-02-03 15:45:29 +0000
committerJohannes Schickel2010-02-03 15:45:29 +0000
commit2cb82808ebb8b7b0c938cc20d5b9446182177459 (patch)
tree38db153dbed6e635ee1e01d4bff7c57a144645a0 /test/sound/raw.h
parente9f831c1dabddb0ed700f0733313083dd8004564 (diff)
downloadscummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.tar.gz
scummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.tar.bz2
scummvm-rg350-2cb82808ebb8b7b0c938cc20d5b9446182177459.zip
Add unit test for RawStream::getLength.
svn-id: r47858
Diffstat (limited to 'test/sound/raw.h')
-rw-r--r--test/sound/raw.h15
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;
+ }
};