summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2013-06-21 13:01:34 +0200
committerJohn Glover <j@johnglover.net>2013-06-21 13:01:34 +0200
commit0748af1f211540bced097b8438c29ea58d202739 (patch)
treee7188bc11b2160be318f56cf460e47700f9e2d94 /tests
parentacfa96cb1f22aab00a3ec310a93b40f0adf3fe35 (diff)
downloadsimpl-0748af1f211540bced097b8438c29ea58d202739.tar.gz
simpl-0748af1f211540bced097b8438c29ea58d202739.tar.bz2
simpl-0748af1f211540bced097b8438c29ea58d202739.zip
[tests] Add basic SndObjSynthesis tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_synthesis.cpp21
-rw-r--r--tests/test_synthesis.h24
-rw-r--r--tests/tests.cpp1
3 files changed, 46 insertions, 0 deletions
diff --git a/tests/test_synthesis.cpp b/tests/test_synthesis.cpp
index c861be0..85ae5d7 100644
--- a/tests/test_synthesis.cpp
+++ b/tests/test_synthesis.cpp
@@ -183,3 +183,24 @@ void TestSMSSynthesis::test_basic() {
void TestSMSSynthesis::test_changing_frame_size() {
::test_changing_frame_size(&_pd, &_pt, &_synth, &_sf);
}
+
+
+// ---------------------------------------------------------------------------
+// TestSndObjSynthesis
+// ---------------------------------------------------------------------------
+void TestSndObjSynthesis::setUp() {
+ _sf = SndfileHandle(TEST_AUDIO_FILE);
+
+ if(_sf.error() > 0) {
+ throw Exception(std::string("Could not open audio file: ") +
+ std::string(TEST_AUDIO_FILE));
+ }
+}
+
+void TestSndObjSynthesis::test_basic() {
+ ::test_basic(&_pd, &_pt, &_synth, &_sf);
+}
+
+void TestSndObjSynthesis::test_changing_frame_size() {
+ ::test_changing_frame_size(&_pd, &_pt, &_synth, &_sf);
+}
diff --git a/tests/test_synthesis.h b/tests/test_synthesis.h
index 8f9ec77..28c9add 100644
--- a/tests/test_synthesis.h
+++ b/tests/test_synthesis.h
@@ -80,6 +80,30 @@ protected:
void test_changing_frame_size();
};
+
+// ---------------------------------------------------------------------------
+// TestSndObjSynthesis
+// ---------------------------------------------------------------------------
+class TestSndObjSynthesis : public CPPUNIT_NS::TestCase {
+ CPPUNIT_TEST_SUITE(TestSndObjSynthesis);
+ CPPUNIT_TEST(test_basic);
+ CPPUNIT_TEST(test_changing_frame_size);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp();
+
+protected:
+ SndObjPeakDetection _pd;
+ SndObjPartialTracking _pt;
+ SndObjSynthesis _synth;
+ SndfileHandle _sf;
+ Frames _frames;
+
+ void test_basic();
+ void test_changing_frame_size();
+};
+
} // end of namespace simpl
#endif
diff --git a/tests/tests.cpp b/tests/tests.cpp
index 11fbebf..dc11c98 100644
--- a/tests/tests.cpp
+++ b/tests/tests.cpp
@@ -20,6 +20,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(simpl::TestLorisPartialTracking);
CPPUNIT_TEST_SUITE_REGISTRATION(simpl::TestMQSynthesis);
CPPUNIT_TEST_SUITE_REGISTRATION(simpl::TestLorisSynthesis);
CPPUNIT_TEST_SUITE_REGISTRATION(simpl::TestSMSSynthesis);
+CPPUNIT_TEST_SUITE_REGISTRATION(simpl::TestSndObjSynthesis);
int main(int arg, char **argv) {
CppUnit::TextTestRunner runner;