Fixed #1070 (Improve scope error message)

This commit is contained in:
Daniel Marjamäki 2010-01-12 19:34:33 +01:00
parent 814eb6caee
commit 374def4a53
2 changed files with 3 additions and 3 deletions

View File

@ -2081,7 +2081,7 @@ void CheckOther::charBitOpError(const Token *tok)
void CheckOther::variableScopeError(const Token *tok, const std::string &varname)
{
reportError(tok, Severity::style, "variableScope", "The scope of the variable " + varname + " can be limited");
reportError(tok, Severity::style, "variableScope", "The scope of the variable " + varname + " can be reduced");
}
void CheckOther::conditionAlwaysTrueFalse(const Token *tok, const std::string &truefalse)

View File

@ -534,7 +534,7 @@ private:
" for ( ; i < 10; ++i) ;\n"
" }\n"
"}\n");
ASSERT_EQUALS("[test.cpp:3]: (style) The scope of the variable i can be limited\n", errout.str());
ASSERT_EQUALS("[test.cpp:3]: (style) The scope of the variable i can be reduced\n", errout.str());
varScope("void f(int x)\n"
"{\n"
@ -544,7 +544,7 @@ private:
" for ( ; i < 10; ++i) ;\n"
" }\n"
"}\n");
ASSERT_EQUALS("[test.cpp:3]: (style) The scope of the variable i can be limited\n", errout.str());
ASSERT_EQUALS("[test.cpp:3]: (style) The scope of the variable i can be reduced\n", errout.str());
}
void varScope6()