summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestDecoratorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cppunittest/TestDecoratorTest.cpp')
-rw-r--r--examples/cppunittest/TestDecoratorTest.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/examples/cppunittest/TestDecoratorTest.cpp b/examples/cppunittest/TestDecoratorTest.cpp
new file mode 100644
index 0000000..f05fce5
--- /dev/null
+++ b/examples/cppunittest/TestDecoratorTest.cpp
@@ -0,0 +1,55 @@
+#include "TestDecoratorTest.h"
+#include "FailingTestCase.h"
+#include <cppunit/TestResult.h>
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION( TestDecoratorTest );
+
+
+TestDecoratorTest::TestDecoratorTest()
+{
+}
+
+
+TestDecoratorTest::~TestDecoratorTest()
+{
+}
+
+
+void
+TestDecoratorTest::setUp()
+{
+ m_test = new FailingTestCase();
+ m_decorator = new CppUnit::TestDecorator( m_test );
+}
+
+
+void
+TestDecoratorTest::tearDown()
+{
+ delete m_decorator;
+ delete m_test;
+}
+
+
+void
+TestDecoratorTest::testCountTestCases()
+{
+ CPPUNIT_ASSERT_EQUAL( 1, m_decorator->countTestCases() );
+}
+
+
+void
+TestDecoratorTest::testRun()
+{
+ CppUnit::TestResult result;
+ m_decorator->run( &result );
+ m_test->verify();
+}
+
+
+void
+TestDecoratorTest::testGetName()
+{
+ CPPUNIT_ASSERT_EQUAL( m_test->getName(), m_decorator->getName() );
+}