diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index a747bddaa..0e6e6b1a6 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -429,6 +429,13 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p - otherwise it is redundant to check if p is null at line 4\n", errout.str()); + check("void foo(char *p)\n" + "{\n" + " if (*p == 0) { }\n" + " if (!p) { }\n" + "}\n"); + TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p - otherwise it is redundant to check if p is null at line 4\n", "", errout.str()); + // no error check("void foo()\n" "{\n"