summaryrefslogtreecommitdiff
path: root/include/cppunit/extensions/RepeatedTest.h
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2001-06-11 19:00:08 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2001-06-11 19:00:08 +0000
commite38eb47e23d6106c32ee136351b0080313339270 (patch)
tree7989d9f5435ed23b30ef45b9f3cd40f00cafc391 /include/cppunit/extensions/RepeatedTest.h
parentc7a4dccd9f1b1fadcd47afe482c8a8ff9e05ea8f (diff)
downloadcppunit-e38eb47e23d6106c32ee136351b0080313339270.tar.gz
Include/cppunit/extensions/HelperMacros.
include/cppunit/extensions/HelperMacros.h: static method suite() implemented by CPPUNIT_TEST_SUITE_END macro now returns a TestSuite instead of a Test. * include/cppunit/extensions/RepeatedTest.h: corrected countTestCases, operator = declaration. * include/cppunit/extensions/TestDecorator.h: removed const from run() method. Did not match run() declaration of Test class. * include/cppunit/extensions/TestFactory.h: fixed a comment. * include/cppunit/extensions/TestSetup.h: corrected run() method declaration. Methods setUp() and tearDown() were not declared virtual. * include/cppunit/extensions/TestSuiteBuilder.h: added a method addTestCaller() which take a pointer on a fixture.
Diffstat (limited to 'include/cppunit/extensions/RepeatedTest.h')
-rw-r--r--include/cppunit/extensions/RepeatedTest.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/include/cppunit/extensions/RepeatedTest.h b/include/cppunit/extensions/RepeatedTest.h
index b96b6ec..7a68e88 100644
--- a/include/cppunit/extensions/RepeatedTest.h
+++ b/include/cppunit/extensions/RepeatedTest.h
@@ -14,45 +14,26 @@ class TestResult;
* Does not assume ownership of the test it decorates
*
*/
-
class RepeatedTest : public TestDecorator
{
public:
- RepeatedTest (Test *test, int timesRepeat)
- : TestDecorator (test), m_timesRepeat (timesRepeat) {}
+ RepeatedTest( Test *test,
+ int timesRepeat ) :
+ TestDecorator( test ),
+ m_timesRepeat(timesRepeat) {}
- int countTestCases ();
- std::string toString ();
- void run (TestResult *result);
+ int countTestCases();
+ std::string toString();
+ void run( TestResult *result );
private:
RepeatedTest( const RepeatedTest & );
- void operator( const RepeatedTest & );
+ void operator=( const RepeatedTest & );
- const int m_timesRepeat;
+ const int m_timesRepeat;
};
-// Counts the number of test cases that will be run by this test.
-inline RepeatedTest::countTestCases ()
-{ return TestDecorator::countTestCases () * m_timesRepeat; }
-
-// Returns the name of the test instance.
-inline std::string RepeatedTest::toString ()
-{ return TestDecorator::toString () + " (repeated)"; }
-
-// Runs a repeated test
-inline void RepeatedTest::run (TestResult *result)
-{
- for (int n = 0; n < m_timesRepeat; n++) {
- if (result->shouldStop ())
- break;
-
- TestDecorator::run (result);
- }
-}
-
-
} // namespace CppUnit