aboutsummaryrefslogtreecommitdiff
path: root/test/sound/timestamp.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/sound/timestamp.h')
-rw-r--r--test/sound/timestamp.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/sound/timestamp.h b/test/sound/timestamp.h
index 4945a18f88..d4cd0edc44 100644
--- a/test/sound/timestamp.h
+++ b/test/sound/timestamp.h
@@ -87,8 +87,32 @@ class TimestampTestSuite : public CxxTest::TestSuite
void test_equals() {
const Audio::Timestamp a = Audio::Timestamp(500, 1000);
- const Audio::Timestamp b = Audio::Timestamp(0, 1000).addFrames(500);
+ Audio::Timestamp b = Audio::Timestamp(0, 1000);
+ Audio::Timestamp c = Audio::Timestamp(0, 100);
+
+ TS_ASSERT(a != b);
+ TS_ASSERT(a != c);
+ TS_ASSERT(b == c);
+
+ b = b.addFrames(500);
+ c = c.addFrames(50);
TS_ASSERT(a == b);
+ TS_ASSERT(a == c);
+ TS_ASSERT(b == c);
+ }
+
+
+ void test_framerate() {
+ const Audio::Timestamp a = Audio::Timestamp(500, 1000);
+ const Audio::Timestamp b = Audio::Timestamp(500, 67);
+ const Audio::Timestamp c = Audio::Timestamp(500, 100);
+ const Audio::Timestamp d = Audio::Timestamp(500, 44100);
+
+
+ TS_ASSERT_EQUALS(a.getFramerate(), 1000);
+ TS_ASSERT_EQUALS(b.getFramerate(), 67);
+ TS_ASSERT_EQUALS(c.getFramerate(), 100);
+ TS_ASSERT_EQUALS(d.getFramerate(), 44100);
}
};