Remove trailing whitespace (#3668)

This commit is contained in:
John Vandenberg
2022-07-07 17:18:20 +08:00
committed by GitHub
parent 0af9524e16
commit 0e6e16645c
1330 changed files with 23570 additions and 23571 deletions

View File

@@ -20,8 +20,8 @@ class CppUnit_API CppUnitException: public std::exception
/// descriptive strings through its what() method
{
public:
CppUnitException(const std::string& message = "",
long lineNumber = CPPUNIT_UNKNOWNLINENUMBER,
CppUnitException(const std::string& message = "",
long lineNumber = CPPUNIT_UNKNOWNLINENUMBER,
const std::string& fileName = CPPUNIT_UNKNOWNFILENAME);
CppUnitException(const std::string& message,
long lineNumber,
@@ -110,26 +110,26 @@ inline const char* CppUnitException::what() const throw ()
inline long CppUnitException::lineNumber() const
{
return _lineNumber;
return _lineNumber;
}
inline long CppUnitException::data1LineNumber() const
{
return _data1lineNumber;
return _data1lineNumber;
}
inline long CppUnitException::data2LineNumber() const
{
return _data2lineNumber;
return _data2lineNumber;
}
// The file in which the error occurred
inline const std::string& CppUnitException::fileName() const
{
return _fileName;
return _fileName;
}

View File

@@ -45,11 +45,11 @@ namespace CppUnit {
*
* see TestSuite
*/
template <class ClassUnderTest>
template <class ClassUnderTest>
class Orthodox: public TestCase
{
public:
Orthodox(): TestCase("Orthodox")
Orthodox(): TestCase("Orthodox")
{
}
@@ -60,7 +60,7 @@ protected:
// Run an orthodoxy test
template <class ClassUnderTest>
template <class ClassUnderTest>
void Orthodox<ClassUnderTest>::runTest()
{
// make sure we have a default constructor
@@ -90,7 +90,7 @@ void Orthodox<ClassUnderTest>::runTest()
// Exercise a call
template <class ClassUnderTest>
template <class ClassUnderTest>
ClassUnderTest Orthodox<ClassUnderTest>::call(ClassUnderTest object)
{
return object;

View File

@@ -29,7 +29,7 @@ class CppUnit_API RepeatedTest: public TestDecorator
REFERENCEOBJECT (RepeatedTest)
public:
RepeatedTest(Test* test, int timesRepeat): TestDecorator (test), _timesRepeat (timesRepeat)
RepeatedTest(Test* test, int timesRepeat): TestDecorator (test), _timesRepeat (timesRepeat)
{
}
@@ -59,7 +59,7 @@ inline std::string RepeatedTest::toString()
// Runs a repeated test
inline void RepeatedTest::run(TestResult *result)
{
for (int n = 0; n < _timesRepeat; n++)
for (int n = 0; n < _timesRepeat; n++)
{
if (result->shouldStop())
break;

View File

@@ -64,7 +64,7 @@ inline void Test::run(TestResult *result, const Callback& callback)
// Counts the number of test cases that will be run by this test.
inline int Test::countTestCases() const
{
return 0;
return 0;
}

View File

@@ -57,7 +57,7 @@ inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownExcept
// Deletes the owned exception.
inline TestFailure::~TestFailure()
{
{
delete _thrownException;
}

View File

@@ -67,7 +67,7 @@ public:
SynchronizationObject()
{
}
virtual ~SynchronizationObject()
{
}
@@ -75,7 +75,7 @@ public:
virtual void lock()
{
}
virtual void unlock()
{
}
@@ -112,7 +112,7 @@ protected:
// Construct a TestResult
inline TestResult::TestResult(): _syncObject(new SynchronizationObject())
{
_runTests = 0;
_runTests = 0;
_stop = false;
}
@@ -121,7 +121,7 @@ inline TestResult::TestResult(): _syncObject(new SynchronizationObject())
// caused the error
inline void TestResult::addError(Test* test, CppUnitException* e)
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
_errors.push_back(new TestFailure(test, e));
}
@@ -130,7 +130,7 @@ inline void TestResult::addError(Test* test, CppUnitException* e)
// caused the failure.
inline void TestResult::addFailure(Test* test, CppUnitException* e)
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
_failures.push_back(new TestFailure(test, e));
}
@@ -138,7 +138,7 @@ inline void TestResult::addFailure(Test* test, CppUnitException* e)
// Informs the result that a test will be started.
inline void TestResult::startTest(Test* test)
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
_runTests++;
}
@@ -153,7 +153,7 @@ inline void TestResult::endTest(Test* test)
// Gets the number of run tests.
inline int TestResult::runTests()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return _runTests;
}
@@ -161,7 +161,7 @@ inline int TestResult::runTests()
// Gets the number of detected errors.
inline int TestResult::testErrors()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return (int) _errors.size();
}
@@ -169,7 +169,7 @@ inline int TestResult::testErrors()
// Gets the number of detected failures.
inline int TestResult::testFailures()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return (int) _failures.size();
}
@@ -177,15 +177,15 @@ inline int TestResult::testFailures()
// Returns whether the entire test was successful or not.
inline bool TestResult::wasSuccessful()
{
ExclusiveZone zone(_syncObject);
return _failures.size() == 0 && _errors.size () == 0;
ExclusiveZone zone(_syncObject);
return _failures.size() == 0 && _errors.size () == 0;
}
// Returns a std::vector of the errors.
inline std::vector<TestFailure*>& TestResult::errors()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return _errors;
}
@@ -193,7 +193,7 @@ inline std::vector<TestFailure*>& TestResult::errors()
// Returns a std::vector of the failures.
inline std::vector<TestFailure*>& TestResult::failures()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return _failures;
}
@@ -201,7 +201,7 @@ inline std::vector<TestFailure*>& TestResult::failures()
// Returns whether testing should be stopped
inline bool TestResult::shouldStop()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
return _stop;
}
@@ -209,7 +209,7 @@ inline bool TestResult::shouldStop()
// Stop testing
inline void TestResult::stop()
{
ExclusiveZone zone(_syncObject);
ExclusiveZone zone(_syncObject);
_stop = true;
}
@@ -218,7 +218,7 @@ inline void TestResult::stop()
// TestResult assumes ownership of the object
inline void TestResult::setSynchronizationObject(SynchronizationObject* syncObject)
{
delete _syncObject;
delete _syncObject;
_syncObject = syncObject;
}

View File

@@ -24,17 +24,17 @@ class CppUnit_API TestSetup: public TestDecorator
REFERENCEOBJECT (TestSetup)
public:
TestSetup(Test* test): TestDecorator(test)
TestSetup(Test* test): TestDecorator(test)
{
}
void run(TestResult* result);
protected:
void setUp()
void setUp()
{
}
void tearDown()
{
}
@@ -44,7 +44,7 @@ protected:
inline void TestSetup::run(TestResult* result)
{
setUp();
TestDecorator::run(result);
TestDecorator::run(result);
tearDown();
}

View File

@@ -48,7 +48,7 @@ public:
Test::Type getType() const;
virtual void deleteContents();
const std::vector<Test*> tests() const;
private:
@@ -80,7 +80,7 @@ inline void TestSuite::addTest(Test* test)
// Returns a std::string representation of the test suite.
inline std::string TestSuite::toString() const
{
return "suite " + _name;
return "suite " + _name;
}
// Returns the type of the test, see Test::Type

View File

@@ -31,7 +31,7 @@ public:
virtual void printErrors(std::ostream& stream);
virtual void printFailures(std::ostream& stream);
virtual void printHeader(std::ostream& stream);
protected:
std::string shortName(const std::string& testName);
void setup();

View File

@@ -32,26 +32,26 @@ inline std::string estring(std::string& expandedString)
// Create a std::string from an int
inline std::string estring(int number)
{
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%d", number);
return std::string (buffer);
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%d", number);
return std::string (buffer);
}
// Create a string from a long
inline std::string estring(long number)
{
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%ld", number);
return std::string (buffer);
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%ld", number);
return std::string (buffer);
}
// Create a std::string from a double
inline std::string estring(double number)
{
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%lf", number);
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%lf", number);
return std::string(buffer);
}
@@ -59,8 +59,8 @@ inline std::string estring(double number)
// Create a std::string from a double
inline std::string estring(const void* ptr)
{
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%p", ptr);
char buffer[50];
std::snprintf(buffer, sizeof(buffer), "%p", ptr);
return std::string(buffer);
}