testinternal: add testcase for TP warning for "previous()->next()"
This commit is contained in:
parent
ece478979b
commit
56525cba60
|
@ -309,6 +309,12 @@ private:
|
||||||
" return tok->next()->next()->str();\n"
|
" return tok->next()->next()->str();\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:2]: (style) Call to 'Token::next()' followed by 'Token::str()' can be simplified.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:2]: (style) Call to 'Token::next()' followed by 'Token::str()' can be simplified.\n", errout.str());
|
||||||
|
|
||||||
|
check("void f() {\n"
|
||||||
|
" return tok->previous()->next()->str();\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:2]: (style) Call to 'Token::previous()' followed by 'Token::next()' can be simplified.\n", errout.str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void internalError() {
|
void internalError() {
|
||||||
|
|
Loading…
Reference in New Issue