mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-10-29 09:42:31 +00: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:
committed by
Alex Fabijanic
parent
6677a0aec4
commit
b2a0483805
@@ -10,14 +10,13 @@
|
|||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/TestDecorator.h"
|
#include "CppUnit/TestDecorator.h"
|
||||||
|
#include "CppUnit/TestResult.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
class TestResult;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A decorator that runs a test repeatedly.
|
* A decorator that runs a test repeatedly.
|
||||||
@@ -35,7 +34,7 @@ public:
|
|||||||
|
|
||||||
int countTestCases();
|
int countTestCases();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
void run(TestResult *result);
|
void run(TestResult* result, const Test::Callback& callback = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int _timesRepeat;
|
const int _timesRepeat;
|
||||||
@@ -43,7 +42,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
// Counts the number of test cases that will be run by this test.
|
// Counts the number of test cases that will be run by this test.
|
||||||
inline RepeatedTest::countTestCases ()
|
inline int RepeatedTest::countTestCases()
|
||||||
{
|
{
|
||||||
return TestDecorator::countTestCases() * _timesRepeat;
|
return TestDecorator::countTestCases() * _timesRepeat;
|
||||||
}
|
}
|
||||||
@@ -57,7 +56,7 @@ inline std::string RepeatedTest::toString()
|
|||||||
|
|
||||||
|
|
||||||
// Runs a repeated test
|
// 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++)
|
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.
|
// 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
|
* 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
|
* See TestCase
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
int countTestCases() const;
|
int countTestCases() const;
|
||||||
|
|
||||||
void run(TestResult* result, const Test::Callback& callback);
|
void run(TestResult* result, const Test::Callback& callback = nullptr);
|
||||||
|
|
||||||
std::string toString() const;
|
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);
|
_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)
|
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||||
{
|
{
|
||||||
if (result->shouldStop ())
|
if (result->shouldStop())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Test *test = *it;
|
Test *test = *it;
|
||||||
@@ -39,7 +39,7 @@ int TestSuite::countTestCases() const
|
|||||||
{
|
{
|
||||||
int count = 0;
|
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();
|
count += (*it)->countTestCases();
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|||||||
Reference in New Issue
Block a user