style fixes

This commit is contained in:
Günter Obiltschnig
2020-01-04 12:38:43 +01:00
parent 09919478ce
commit 5284be25ae
2 changed files with 13 additions and 10 deletions

View File

@@ -135,7 +135,7 @@ protected:
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
void assertEquals(const std::string& expected, void assertEquals(const std::string& expected,
const std::string& actual, const std::string& actual,
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
@@ -155,7 +155,7 @@ protected:
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
void assertNull(const void* pointer, void assertNull(const void* pointer,
const std::string& pointerExpression = "", const std::string& pointerExpression = "",
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
@@ -192,14 +192,14 @@ inline TestCase::~TestCase()
// Returns a count of all the tests executed // Returns a count of all the tests executed
inline int TestCase::countTestCases() const inline int TestCase::countTestCases() const
{ {
return 1; return 1;
} }
// Returns the name of the test case // Returns the name of the test case
inline const std::string& TestCase::name() const inline const std::string& TestCase::name() const
{ {
return _name; return _name;
} }
@@ -224,22 +224,25 @@ inline void TestCase::tearDown()
// Returns the name of the test case instance // Returns the name of the test case instance
inline std::string TestCase::toString() const inline std::string TestCase::toString() const
{ {
const std::type_info& thisClass = typeid(*this); const std::type_info& thisClass = typeid(*this);
return std::string(thisClass.name()) + "." + name(); return std::string(thisClass.name()) + "." + name();
} }
// Returns the type of the test, see Test::Type // Returns the type of the test, see Test::Type
inline Test::Type TestCase::getType() const inline Test::Type TestCase::getType() const
{ {
return _type; return _type;
} }
// Set the type of the test, see Test::Type // Set the type of the test, see Test::Type
inline void TestCase::setType(Test::Type testType) inline void TestCase::setType(Test::Type testType)
{ {
_type = testType; _type = testType;
} }
// A set of macros which allow us to get the line number // A set of macros which allow us to get the line number
// and file name at the point of an error. // and file name at the point of an error.
// Just goes to show that preprocessors do have some // Just goes to show that preprocessors do have some
@@ -271,7 +274,7 @@ inline void TestCase::setType(Test::Type testType)
#define assertNullPtr(ptr) \ #define assertNullPtr(ptr) \
(this->assertNull((ptr), #ptr, __LINE__, __FILE__)) (this->assertNull((ptr), #ptr, __LINE__, __FILE__))
#define assertNotNullPtr(ptr) \ #define assertNotNullPtr(ptr) \
(this->assertNotNull((ptr), #ptr, __LINE__, __FILE__)) (this->assertNotNull((ptr), #ptr, __LINE__, __FILE__))

View File

@@ -49,7 +49,7 @@ bool TestRunner::run(const std::vector<std::string>& args)
bool all = false; bool all = false;
bool wait = false; bool wait = false;
bool printed = false; bool printed = false;
bool long_running = false; bool longRunning = false;
std::string ignore; std::string ignore;
std::vector<std::string> setup; std::vector<std::string> setup;
@@ -70,7 +70,7 @@ bool TestRunner::run(const std::vector<std::string>& args)
} }
else if (arg == "-long") else if (arg == "-long")
{ {
long_running = true; longRunning = true;
continue; continue;
} }
else if (arg == "-ignore") else if (arg == "-ignore")
@@ -134,7 +134,7 @@ bool TestRunner::run(const std::vector<std::string>& args)
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)
{ {
Test* testToRun = *it; Test* testToRun = *it;
if(testToRun->getType() == Test::Long && !long_running) if(testToRun->getType() == Test::Long && !longRunning)
continue; continue;
if (setup.size() > 0) if (setup.size() > 0)
testToRun->addSetup(setup); testToRun->addSetup(setup);