CheckCondition::alwaysTrueFalseError: put condition in single quotes.

This commit is contained in:
Matthias Krüger 2015-07-30 16:13:10 +02:00
parent 251f6d2a15
commit 21ed807f8d
2 changed files with 2 additions and 2 deletions

View File

@ -1012,5 +1012,5 @@ void CheckCondition::alwaysTrueFalseError(const Token *tok, bool knownResult)
reportError(tok,
Severity::style,
"knownConditionTrueFalse",
"Condition " + expr + " is always " + (knownResult ? "true" : "false"));
"Condition '" + expr + "' is always " + (knownResult ? "true" : "false"));
}

View File

@ -1519,7 +1519,7 @@ private:
" if (a) { return; }\n" // <- this is just here to fool simplifyKnownVariabels
" if (!x) {}\n"
"}");
ASSERT_EQUALS("[test.cpp:4]: (style) Condition !x is always true\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (style) Condition '!x' is always true\n", errout.str());
check("void f() {\n" // #6898 (Token::expressionString)
" int x = 0;\n"