From 56525cba60771614587b0c6219100cb818f0c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 25 Aug 2016 16:09:06 +0200 Subject: [PATCH] testinternal: add testcase for TP warning for "previous()->next()" --- test/testinternal.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 1b2354236..406dde968 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -309,6 +309,12 @@ private: " 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()); + + 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() {