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
3 changes: 1 addition & 2 deletions test/fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ TestFixture::TestFixture(const char * const _name)

bool TestFixture::prepareTest(const char testname[])
{
mVerbose = false;
mTemplateFormat.clear();
mTemplateLocation.clear();
CppCheck::resetTimerResults();
Expand Down Expand Up @@ -439,7 +438,7 @@ void TestFixture::reportErr(const ErrorMessage &msg)
return;
std::string errormessage;
if (!mTemplateFormat.empty()) {
errormessage = msg.toString(mVerbose, mTemplateFormat, mTemplateLocation);
errormessage = msg.toString(false, mTemplateFormat, mTemplateLocation);
}
else {
if (!msg.callStack.empty()) {
Expand Down
7 changes: 1 addition & 6 deletions test/fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class TestFixture : public ErrorLogger {
static std::size_t fails_counter;
static std::size_t todos_counter;
static std::size_t succeeded_todos_counter;
bool mVerbose{};
std::string mTemplateFormat;
std::string mTemplateLocation;
std::string mTestname;
Expand Down Expand Up @@ -124,10 +123,6 @@ class TestFixture : public ErrorLogger {
void assertNoThrowFail(const char * filename, unsigned int linenr, bool bailout) const;
static std::string deleteLineNumber(const std::string &message);

void setVerbose(bool v) {
mVerbose = v;
}

void setTemplateFormat(const std::string &templateFormat);

void setMultiline() {
Expand Down Expand Up @@ -319,7 +314,7 @@ class TestInstance {
std::unique_ptr<TestFixture> impl;
};

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

#define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, (CONDITION))
#define ASSERT_MSG( CONDITION, MSG ) assert_(__FILE__, __LINE__, (CONDITION), MSG)
Expand Down