1#include <cppunit/extensions/RepeatedTest.h>
2#include <cppunit/TestResult.h>
3
4namespace CppUnit {
5
6
7using std::string;
8
9// Counts the number of test cases that will be run by this test.
10int
11RepeatedTest::countTestCases() const
12{
13  return TestDecorator::countTestCases () * m_timesRepeat;
14}
15
16
17// Returns the name of the test instance.
18string
19RepeatedTest::toString() const
20{
21  return TestDecorator::toString () + " (repeated)";
22}
23
24// Runs a repeated test
25void
26RepeatedTest::run( TestResult *result )
27{
28  for ( int n = 0; n < m_timesRepeat; n++ )
29  {
30    if ( result->shouldStop() )
31        break;
32
33    TestDecorator::run( result );
34  }
35}
36
37
38} // namespace TestAssert
39