diff --git a/libs/temporal/test/TempoMapCutBufferTest.cc b/libs/temporal/test/TempoMapCutBufferTest.cc new file mode 100644 index 0000000000..23ee49e188 --- /dev/null +++ b/libs/temporal/test/TempoMapCutBufferTest.cc @@ -0,0 +1,46 @@ +#include + +#include "temporal/tempo.h" + +#include "TempoMapCutBufferTest.h" + +CPPUNIT_TEST_SUITE_REGISTRATION(TempoMapCutBufferTest); + +using namespace Temporal; + +void +TempoMapCutBufferTest::createTest() +{ + CPPUNIT_ASSERT (TempoMap::use() != 0); +} + +void +TempoMapCutBufferTest::cutTest() +{ + TempoMap::WritableSharedPtr tmap (TempoMap::write_copy()); + TempoPoint& tp = tmap->set_tempo (Tempo (180, 4), BBT_Argument (6, 1, 0)); + tmap->set_meter (Meter (6, 8), BBT_Argument (3, 1, 0)); + + /* tp is at 6|1|0 which is 3|0|0 after the 6/8 meter at ((3-1) * 4 =) 8 + * quarter notes), so 3 bars of 6 + * 8th notes, or 18 8 notes, or 9 4th notes. So its quarter time should + * be 8 + 9 = 17 + */ + + std::cout << "\n\n\n ***************** tp = " << tp.beats() << std::endl; + + CPPUNIT_ASSERT (tp.beats() == Beats (17,0)); + + + tmap->abort_update (); +} + +void +TempoMapCutBufferTest::copyTest() +{ +} + +void +TempoMapCutBufferTest::pasteTest() +{ +} diff --git a/libs/temporal/test/TempoMapCutBufferTest.h b/libs/temporal/test/TempoMapCutBufferTest.h new file mode 100644 index 0000000000..c15c5e4020 --- /dev/null +++ b/libs/temporal/test/TempoMapCutBufferTest.h @@ -0,0 +1,18 @@ +#include +#include + +class TempoMapCutBufferTest : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE(TempoMapCutBufferTest); + CPPUNIT_TEST(createTest); + CPPUNIT_TEST(cutTest); + CPPUNIT_TEST(copyTest); + CPPUNIT_TEST(pasteTest); + CPPUNIT_TEST_SUITE_END(); + +public: + void createTest(); + void cutTest(); + void copyTest(); + void pasteTest(); +}; diff --git a/libs/temporal/wscript b/libs/temporal/wscript index 7cd1cba246..8f3518ae4e 100644 --- a/libs/temporal/wscript +++ b/libs/temporal/wscript @@ -87,6 +87,7 @@ def build(bld): 'test/BeatTest.cc', 'test/BBTTest.cc', 'test/TempoMapTest.cc', + 'test/TempoMapCutBufferTest.cc', 'test/TimelineTest.cc', 'test/RangeTest.cc', 'test/testrunner.cc',