summaryrefslogtreecommitdiff
path: root/examples/cppunittest/SubclassedTestCase.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cppunittest/SubclassedTestCase.h')
-rw-r--r--examples/cppunittest/SubclassedTestCase.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/cppunittest/SubclassedTestCase.h b/examples/cppunittest/SubclassedTestCase.h
new file mode 100644
index 0000000..84e6e7f
--- /dev/null
+++ b/examples/cppunittest/SubclassedTestCase.h
@@ -0,0 +1,35 @@
+#ifndef SUBCLASSEDTESTCASE_H
+#define SUBCLASSEDTESTCASE_H
+
+#include "BaseTestCase.h"
+
+
+class SubclassedTestCase : public BaseTestCase
+{
+ CPPUNIT_TEST_SUB_SUITE( SubclassedTestCase, BaseTestCase );
+ CPPUNIT_TEST( testSubclassing );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ SubclassedTestCase();
+ virtual ~SubclassedTestCase();
+
+ virtual void setUp();
+ virtual void tearDown();
+
+ // Another test to ensure the subclassed test case are in the suite .
+ void testSubclassing();
+
+protected:
+ // We overload this method to ensure that the testUsingCheckIt in the
+ // parent class will fail.
+ virtual void checkIt();
+
+private:
+ SubclassedTestCase( const SubclassedTestCase &copy );
+ void operator =( const SubclassedTestCase &copy );
+};
+
+
+
+#endif // SUBCLASSEDTESTCASE_H