Skip to content

Commit d1698b3

Browse files
authored
TestFixture: removed unused mVerbose (danmar#7841)
1 parent 23c3aa3 commit d1698b3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

test/fixture.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ TestFixture::TestFixture(const char * const _name)
9292

9393
bool TestFixture::prepareTest(const char testname[])
9494
{
95-
mVerbose = false;
9695
mTemplateFormat.clear();
9796
mTemplateLocation.clear();
9897
CppCheck::resetTimerResults();
@@ -439,7 +438,7 @@ void TestFixture::reportErr(const ErrorMessage &msg)
439438
return;
440439
std::string errormessage;
441440
if (!mTemplateFormat.empty()) {
442-
errormessage = msg.toString(mVerbose, mTemplateFormat, mTemplateLocation);
441+
errormessage = msg.toString(false, mTemplateFormat, mTemplateLocation);
443442
}
444443
else {
445444
if (!msg.callStack.empty()) {

test/fixture.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class TestFixture : public ErrorLogger {
5151
static std::size_t fails_counter;
5252
static std::size_t todos_counter;
5353
static std::size_t succeeded_todos_counter;
54-
bool mVerbose{};
5554
std::string mTemplateFormat;
5655
std::string mTemplateLocation;
5756
std::string mTestname;
@@ -124,10 +123,6 @@ class TestFixture : public ErrorLogger {
124123
void assertNoThrowFail(const char * filename, unsigned int linenr, bool bailout) const;
125124
static std::string deleteLineNumber(const std::string &message);
126125

127-
void setVerbose(bool v) {
128-
mVerbose = v;
129-
}
130-
131126
void setTemplateFormat(const std::string &templateFormat);
132127

133128
void setMultiline() {
@@ -319,7 +314,7 @@ class TestInstance {
319314
std::unique_ptr<TestFixture> impl;
320315
};
321316

322-
#define TEST_CASE( NAME ) do { if (prepareTest(#NAME)) { setVerbose(false); try { NAME(); teardownTest(); } catch (const AssertFailedError&) {} catch (...) { assertNoThrowFail(__FILE__, __LINE__, false); } } } while (false)
317+
#define TEST_CASE( NAME ) do { if (prepareTest(#NAME)) { try { NAME(); teardownTest(); } catch (const AssertFailedError&) {} catch (...) { assertNoThrowFail(__FILE__, __LINE__, false); } } } while (false)
323318

324319
#define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, (CONDITION))
325320
#define ASSERT_MSG( CONDITION, MSG ) assert_(__FILE__, __LINE__, (CONDITION), MSG)

0 commit comments

Comments
 (0)