Add one more test case for #895 (false positive: Suspicious pointer subtraction)

This commit is contained in:
Reijo Tomperi 2009-11-04 21:38:40 +02:00
parent 80c66f8ebc
commit 9a55f4ca43
1 changed files with 5 additions and 0 deletions

View File

@ -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());
}
};