From ad704b5e9c985765e14eb38a0922e702b8bfc25a Mon Sep 17 00:00:00 2001 From: John Glover Date: Fri, 11 Jan 2013 17:44:05 +0100 Subject: [tests] Tidy up test C++ tests. All tests can now be run from a single executable called 'tests' (created in the build directory). --- tests/test_peak_detection.h | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/test_peak_detection.h (limited to 'tests/test_peak_detection.h') diff --git a/tests/test_peak_detection.h b/tests/test_peak_detection.h new file mode 100644 index 0000000..5b36f19 --- /dev/null +++ b/tests/test_peak_detection.h @@ -0,0 +1,65 @@ +#ifndef TEST_PEAK_DETECTION_H +#define TEST_PEAK_DETECTION_H + +#include + +#include "../src/simpl/base.h" +#include "../src/simpl/peak_detection.h" +#include "../src/simpl/exceptions.h" +#include "test_common.h" + +namespace simpl +{ + +// --------------------------------------------------------------------------- +// TestMQPeakDetection +// --------------------------------------------------------------------------- +class TestMQPeakDetection : public CPPUNIT_NS::TestCase { + CPPUNIT_TEST_SUITE(TestMQPeakDetection); + CPPUNIT_TEST(test_find_peaks_in_frame_basic); + CPPUNIT_TEST(test_find_peaks_basic); + CPPUNIT_TEST(test_find_peaks_audio); + CPPUNIT_TEST(test_find_peaks_change_hop_frame_size); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + +protected: + MQPeakDetection _pd; + SndfileHandle _sf; + + void test_find_peaks_in_frame_basic(); + void test_find_peaks_basic(); + void test_find_peaks_audio(); + void test_find_peaks_change_hop_frame_size(); +}; + + +// --------------------------------------------------------------------------- +// TestLorisPeakDetection +// --------------------------------------------------------------------------- +class TestLorisPeakDetection : public CPPUNIT_NS::TestCase { + CPPUNIT_TEST_SUITE(TestLorisPeakDetection); + CPPUNIT_TEST(test_find_peaks_in_frame_basic); + CPPUNIT_TEST(test_find_peaks_basic); + CPPUNIT_TEST(test_find_peaks_audio); + CPPUNIT_TEST(test_find_peaks_change_hop_frame_size); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + +protected: + LorisPeakDetection _pd; + SndfileHandle _sf; + + void test_find_peaks_in_frame_basic(); + void test_find_peaks_basic(); + void test_find_peaks_audio(); + void test_find_peaks_change_hop_frame_size(); +}; + +} // end of namespace simpl + +#endif -- cgit v1.2.3