Properly fixed test failure and line numbers in uselessCallsEmpty error

This commit is contained in:
PKEuS 2012-07-13 05:15:58 -07:00
parent c6fdd2733b
commit 4ed15d87b6
2 changed files with 2 additions and 2 deletions

View File

@ -1347,7 +1347,7 @@ void CheckStl::uselessCalls()
else if (Token::simpleMatch(tok->linkAt(2)->tokAt(-2), ", 0 )"))
uselessCallsSubstrError(tok, true);
} else if (Token::Match(tok, "[{}:;] %var% . empty ( ) ;") && style)
uselessCallsEmptyError(tok);
uselessCallsEmptyError(tok->next());
}
}

View File

@ -1868,7 +1868,7 @@ private:
" v.empty();\n"
" return v.empty();\n"
"}");
ASSERT_EQUALS("[test.cpp:1]: (warning) Useless call of function 'empty()'. Did you intend to call 'clear()' instead?\n", errout.str());
ASSERT_EQUALS("[test.cpp:2]: (warning) Useless call of function 'empty()'. Did you intend to call 'clear()' instead?\n", errout.str());
}
};