diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-09 19:59:23 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-09 19:59:23 +0000 |
commit | 73461494d75ab794224cbe93021acfa51a8c98a9 (patch) | |
tree | 02738a5c19b178aebb3ae078e1bd2c2e8037eed2 /libs/ardour/test/bbt_test.cc | |
parent | 1244cae5c1799c72dc7624dfd573704c56963ebe (diff) |
Add simple framewalk_to_beats test and normalise naming
of test files.
git-svn-id: svn://localhost/ardour2/branches/3.0@10954 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/test/bbt_test.cc')
-rw-r--r-- | libs/ardour/test/bbt_test.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/ardour/test/bbt_test.cc b/libs/ardour/test/bbt_test.cc new file mode 100644 index 0000000000..4dab5c6f32 --- /dev/null +++ b/libs/ardour/test/bbt_test.cc @@ -0,0 +1,37 @@ +#include <cassert> +#include "ardour/tempo.h" +#include "bbt_test.h" + +CPPUNIT_TEST_SUITE_REGISTRATION(BBTTest); + +using namespace std; +using namespace ARDOUR; + +using Timecode::BBT_Time; + +void +BBTTest::addTest () +{ + TempoMap map(48000); + Tempo tempo(120); + Meter meter(4.0, 4.0); + + map.add_meter (meter, BBT_Time(1, 1, 0)); + + // Test basic operations with a flat tempo map + BBT_Time time = map.bbt_add(BBT_Time(1, 1, 0), BBT_Time(1, 2, 3)); + //cout << "result: BBT_Time(" << time.bars << ", " << time.beats << ", " + // << time.ticks << ")" << endl; + CPPUNIT_ASSERT(time == BBT_Time(2, 3, 3)); + + + time = map.bbt_add(BBT_Time(1, 2, 3), BBT_Time(2, 2, 3)); + //cerr << "result: BBT_Time(" << time.bars << ", " << time.beats << ", " + // << time.ticks << ")" << endl; + CPPUNIT_ASSERT(time == BBT_Time(3, 4, 6)); +} + +void +BBTTest::subtractTest () +{ +} |