summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestDecoratorTest.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2001-06-11 18:56:23 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2001-06-11 18:56:23 +0000
commit0c5051a8acf83fd77a6094177eb0711d3f90d997 (patch)
treea0757b1cae952576f4497d40ccf3aa70a2bf84c8 /examples/cppunittest/TestDecoratorTest.cpp
parent021d0a2611777a06d948735e0ad36cb90ffd413b (diff)
downloadcppunit-0c5051a8acf83fd77a6094177eb0711d3f90d997.tar.gz
Examples/cppunittest/TestResultTest.
examples/cppunittest/TestResultTest.*: renamed TestListenerTest.* * examples/cppunittest/*: added unit tests for: HelperMacros, TestAssert, TestCaller, TestCase, TestFailure, TestResult, TestSuite, TestDecoratorTest, TestSetUp, RepeatedTestTest, Orthodox, Exception.
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() );
+}