Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/internal/TestCPPTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ namespace TestCPP {
* string.
*/
TestCase (
TestObjName&& testName,
function<void()> test,
TestObjName&& name,
function<void()> testFn,
bool testPassedMessage = true,
bool captureOut = false,
bool captureLog = false,
Expand Down Expand Up @@ -289,14 +289,14 @@ namespace TestCPP {
* @param out The stream to write the test failure reason to.
* @param reason The test failure reason to write.
*/
void logFailure (ostream& out, const string& reason) const;
void logFailure (ostream& out, const string& failureReason) const;
/**
* @brief If a test encounters an error while running, this
* function will be called to log the test error.
* @param failureMessage The error message from the test that
* should be logged.
*/
void logTestFailure (const string& failureMessage);
void logTestFailure (const string& failureReason);
/**
* @brief Internal test run controller.
*/
Expand Down
18 changes: 9 additions & 9 deletions src/TestCPPTestCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ namespace TestCPP {

TestCase::TestCase (TestObjName&& name,
function<void()> testFn,
bool msg,
bool testPassedMessage,
bool captureOut, bool captureLog,
bool captureErr,
TestCase::TestCaseOutCompareOptions opt)
{
this->notifyTestPassed = msg;
this->notifyTestPassed = testPassedMessage;
this->test = testFn;

this->testName = name;
Expand Down Expand Up @@ -291,7 +291,7 @@ namespace TestCPP {
return this->lastRunTime;
}

void TestCase::logFailure(ostream& out, const string& reason) const {
void TestCase::logFailure(ostream& out, const string& failureReason) const {
out << fixed;
out << setprecision(TCPPNum::TIME_PRECISION);
out << TCPPStr::TEST << this->testName << TCPPStr::FAIL
Expand All @@ -300,10 +300,10 @@ namespace TestCPP {
TCPPNum::NANOS_IN_SEC
<< TCPPStr::SEC << TCPPStr::PARENR
<< endl;
out << TCPPStr::REASON_ << reason << endl;
out << TCPPStr::REASON_ << failureReason << endl;
}

void TestCase::logTestFailure (const string& reason) {
void TestCase::logTestFailure (const string& failureReason) {
unique_ptr<ostream> logStream = nullptr;

if (this->clogOriginal.get() != nullptr) {
Expand All @@ -315,14 +315,14 @@ namespace TestCPP {
logStream = unique_ptr<ostream>(&clog);
}

logFailure(*logStream, reason);
logFailure(*logStream, failureReason);

if (this->clogOriginal.get() != nullptr) {
logStream->flush();

// If someone is looking for something in the message,
// and it's captured, make sure it's there.
logFailure(clog, reason);
logFailure(clog, failureReason);
}

logStream.release();
Expand Down Expand Up @@ -370,8 +370,8 @@ namespace TestCPP {
return false;
}

void TestCase::setNotifyPassed (bool notify) {
this->notifyTestPassed = notify;
void TestCase::setNotifyPassed (bool shouldNotify) {
this->notifyTestPassed = shouldNotify;
}

void TestCase::captureStdout () {
Expand Down