diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index a747bddaa8f..0e6e6b1a670 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -429,6 +429,13 @@ class TestNullPointer : public TestFixture "}\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"