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_base.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/test_base.h (limited to 'tests/test_base.h') diff --git a/tests/test_base.h b/tests/test_base.h new file mode 100644 index 0000000..2ab20a4 --- /dev/null +++ b/tests/test_base.h @@ -0,0 +1,63 @@ +#ifndef TEST_BASE_H +#define TEST_BASE_H + +#include +#include +#include +#include +#include +#include +#include + +#include "../src/simpl/base.h" + +namespace simpl +{ + +// --------------------------------------------------------------------------- +// TestPeak +// --------------------------------------------------------------------------- +class TestPeak : public CPPUNIT_NS::TestCase { + CPPUNIT_TEST_SUITE(TestPeak); + CPPUNIT_TEST_SUITE_END(); + +protected: + static const double PRECISION = 0.001; + Peak* peak; + +public: + void setUp(); + void tearDown(); +}; + + +// --------------------------------------------------------------------------- +// TestFrame +// --------------------------------------------------------------------------- +class TestFrame : public CPPUNIT_NS::TestCase { + CPPUNIT_TEST_SUITE(TestFrame); + CPPUNIT_TEST(test_size); + CPPUNIT_TEST(test_max_peaks); + CPPUNIT_TEST(test_max_partials); + CPPUNIT_TEST(test_add_peak); + CPPUNIT_TEST(test_clear); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + void tearDown(); + +protected: + static const double PRECISION = 0.001; + Frame* frame; + + void test_size(); + void test_max_peaks(); + void test_max_partials(); + void test_add_peak(); + void test_clear(); +}; + +} // end of namespace simpl + +#endif -- cgit v1.2.3