mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
fix(CppUint) : RepeatedTest compile error (#3759)
* chore(CppUnit) : style format and revise comment fix(CppUnit) : RepeatedTest compile error * chore(CppUnit) : remove TestResult forward declare in RepeatedTest.h
This commit is contained in:
parent
c252b744f6
commit
a41d802ccd
@ -10,14 +10,13 @@
|
||||
#include "CppUnit/CppUnit.h"
|
||||
#include "CppUnit/Guards.h"
|
||||
#include "CppUnit/TestDecorator.h"
|
||||
#include "CppUnit/TestResult.h"
|
||||
|
||||
|
||||
namespace CppUnit {
|
||||
|
||||
|
||||
class Test;
|
||||
class TestResult;
|
||||
|
||||
|
||||
/*
|
||||
* A decorator that runs a test repeatedly.
|
||||
@ -35,7 +34,7 @@ public:
|
||||
|
||||
int countTestCases();
|
||||
std::string toString();
|
||||
void run(TestResult *result);
|
||||
void run(TestResult* result, const Test::Callback& callback = nullptr);
|
||||
|
||||
private:
|
||||
const int _timesRepeat;
|
||||
@ -43,7 +42,7 @@ private:
|
||||
|
||||
|
||||
// Counts the number of test cases that will be run by this test.
|
||||
inline RepeatedTest::countTestCases ()
|
||||
inline int RepeatedTest::countTestCases()
|
||||
{
|
||||
return TestDecorator::countTestCases() * _timesRepeat;
|
||||
}
|
||||
@ -57,7 +56,7 @@ inline std::string RepeatedTest::toString()
|
||||
|
||||
|
||||
// Runs a repeated test
|
||||
inline void RepeatedTest::run(TestResult *result)
|
||||
inline void RepeatedTest::run(TestResult *result, const Test::Callback& callback)
|
||||
{
|
||||
for (int n = 0; n < _timesRepeat; n++)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ inline Test::~Test()
|
||||
|
||||
|
||||
// Runs a test and collects its result in a TestResult instance.
|
||||
inline void Test::run(TestResult *result, const Callback& callback)
|
||||
inline void Test::run(TestResult* result, const Callback& callback)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace CppUnit {
|
||||
* }
|
||||
*
|
||||
* You can use a TestCaller to bind any test method on a TestCase
|
||||
* class, as long as it returns accepts void and returns void.
|
||||
* class, as long as it accepts void and returns void.
|
||||
*
|
||||
* See TestCase
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
int countTestCases() const;
|
||||
|
||||
void run(TestResult* result, const Test::Callback& callback);
|
||||
void run(TestResult* result, const Test::Callback& callback = nullptr);
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
|
@ -26,7 +26,7 @@ int TestDecorator::countTestCases() const
|
||||
}
|
||||
|
||||
|
||||
void TestDecorator::run(TestResult* result, const Test::Callback& callback = nullptr)
|
||||
void TestDecorator::run(TestResult* result, const Test::Callback& callback)
|
||||
{
|
||||
_test->run(result);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ void TestSuite::run(TestResult *result, const Test::Callback& callback)
|
||||
{
|
||||
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||
{
|
||||
if (result->shouldStop ())
|
||||
if (result->shouldStop())
|
||||
break;
|
||||
|
||||
Test *test = *it;
|
||||
@ -39,7 +39,7 @@ int TestSuite::countTestCases() const
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for (std::vector<Test*>::const_iterator it = _tests.begin (); it != _tests.end (); ++it)
|
||||
for (std::vector<Test*>::const_iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||
count += (*it)->countTestCases();
|
||||
|
||||
return count;
|
||||
|
Loading…
Reference in New Issue
Block a user