CheckCondition::alwaysTrueFalseError: put condition in single quotes.
This commit is contained in:
parent
251f6d2a15
commit
21ed807f8d
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue