charvar: fixed todo testcase
This commit is contained in:
parent
d73e6c398f
commit
bd73d0913f
|
@ -698,10 +698,12 @@ void CheckOther::CheckCharVariable()
|
|||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
|
||||
{
|
||||
// Declaring the variable..
|
||||
if (Token::Match(tok, "[{};(,] char %var% [;=,)]"))
|
||||
if (Token::Match(tok, "[{};(,] signed| char %var% [;=,)]"))
|
||||
{
|
||||
// Set tok to point to the variable name
|
||||
tok = tok->tokAt(2);
|
||||
if (tok->str() == "char")
|
||||
tok = tok->next();
|
||||
|
||||
// Check usage of char variable..
|
||||
int indentlevel = 0;
|
||||
|
|
|
@ -74,14 +74,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS(std::string("[test.cpp:4]: (style) Warning - using char variable as array index\n"), errout.str());
|
||||
|
||||
/* TODO
|
||||
check("void foo()\n"
|
||||
"{\n"
|
||||
" signed char ch = 0x80;\n"
|
||||
" buf[ch] = 0;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS(std::string("[test.cpp:4]: (style) Warning - using char variable as array index\n"), errout.str());
|
||||
*/
|
||||
|
||||
check("void foo(char ch)\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue