Name
RepeatedTest
Description
The class
RepeatedTest
(see Figure C-11) is a
subclass of TestDecorator. It runs a
Test for a specified number of repetitions.
RepeatedTest belongs to the namespace
CppUnit. It is declared in
extensions/RepeatedTest.h and implemented in
RepeatedTest.cpp.
![]() |
Declaration
class RepeatedTest : public TestDecorator
Constructors/Destructors
-
RepeatedTest(Test *test, int timesRepeat) A constructor taking the
Testto run and the number of repetitions.
Public Methods
-
int countTestCases( ) const Returns the number of test cases that this
RepeatedTestwill run, which is the number of test cases theTestcontains multiplied by the number of repetitions.-
void run(TestResult *result) A method to run the
RepeatedTest.-
string toString( ) const Returns a
stringrepresentation of theRepeatedTest.
Protected/Private Methods
-
RepeatedTest(const RepeatedTest &) A copy constructor declared
privateto prevent its use.-
void operator=(const RepeatedTest &) A copy operator declared
privateto prevent its use.
Attributes
-
const int m_timesRepeat The number of test repetitions to run (
private).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
