From 9a55f4ca438e98043d7ce3d0a899a3f1f017c31d Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Wed, 4 Nov 2009 21:38:40 +0200 Subject: [PATCH] Add one more test case for #895 (false positive: Suspicious pointer subtraction) --- test/testclass.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testclass.cpp b/test/testclass.cpp index 9d989904d..7b4893bf8 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -766,6 +766,11 @@ private: "this-x ;"); ASSERT_EQUALS("[test.cpp:2]: (possible style) Suspicious pointer subtraction\n", errout.str()); + checkThisSubtraction("; *this = *this-x ;\n" + "this-x ;\n" + "this-x ;\n"); + ASSERT_EQUALS("[test.cpp:2]: (possible style) Suspicious pointer subtraction\n" + "[test.cpp:3]: (possible style) Suspicious pointer subtraction\n", errout.str()); } };