From 2abc107b24f73b8c4664189c34196d9a27a3e339 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 16 Jun 2018 18:05:00 +0200 Subject: Port the rest of the unittests to DGUnit and remove the CppUnit dependency. --- test/notifiertest.cc | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'test/notifiertest.cc') diff --git a/test/notifiertest.cc b/test/notifiertest.cc index 2b2e92e..fe00597 100644 --- a/test/notifiertest.cc +++ b/test/notifiertest.cc @@ -24,7 +24,7 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include +#include "dgunit.h" #include @@ -48,15 +48,13 @@ public: }; class NotifierTest - : public CppUnit::TestFixture + : public DGUnit { - CPPUNIT_TEST_SUITE(NotifierTest); - CPPUNIT_TEST(testTest); - CPPUNIT_TEST_SUITE_END(); - public: - void setUp() { } - void tearDown() { } + NotifierTest() + { + DGUNIT_TEST(NotifierTest::testTest); + } //! This just creates some drumkit. void testTest() @@ -73,9 +71,9 @@ public: std::vector ref; ref.push_back(&foo1); ref.push_back(&foo2); - CPPUNIT_ASSERT_EQUAL(ref.size(), triggers.size()); - CPPUNIT_ASSERT_EQUAL(ref[0], triggers[0]); - CPPUNIT_ASSERT_EQUAL(ref[1], triggers[1]); + DGUNIT_ASSERT_EQUAL(ref.size(), triggers.size()); + DGUNIT_ASSERT_EQUAL(ref[0], triggers[0]); + DGUNIT_ASSERT_EQUAL(ref[1], triggers[1]); notifier.disconnect(&foo1); notifier.disconnect(&foo2); triggers.clear(); @@ -88,9 +86,9 @@ public: std::vector ref; ref.push_back(&foo2); ref.push_back(&foo1); - CPPUNIT_ASSERT_EQUAL(ref.size(), triggers.size()); - CPPUNIT_ASSERT_EQUAL(ref[0], triggers[0]); - CPPUNIT_ASSERT_EQUAL(ref[1], triggers[1]); + DGUNIT_ASSERT_EQUAL(ref.size(), triggers.size()); + DGUNIT_ASSERT_EQUAL(ref[0], triggers[0]); + DGUNIT_ASSERT_EQUAL(ref[1], triggers[1]); notifier.disconnect(&foo1); notifier.disconnect(&foo2); triggers.clear(); @@ -100,4 +98,4 @@ public: }; // Registers the fixture into the 'registry' -CPPUNIT_TEST_SUITE_REGISTRATION(NotifierTest); +static NotifierTest test; -- cgit v1.2.3