From c9cd5ea25065d24440f9cb1d30adcc8a680f4912 Mon Sep 17 00:00:00 2001 From: Martin Ettl Date: Wed, 9 Jun 2010 01:21:52 +0200 Subject: [PATCH] added a todo testcase for ticket 1778 --- test/testother.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 16563ba59..e16fd3562 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -69,6 +69,7 @@ private: TEST_CASE(nullpointer6); TEST_CASE(nullpointer7); TEST_CASE(nullpointer8); + TEST_CASE(nullpointer9); TEST_CASE(uninitvar1); TEST_CASE(uninitvar_alloc); // data is allocated but not initialized @@ -1151,6 +1152,16 @@ private: ASSERT_EQUALS("[test.cpp:4]: (error) Possible null pointer dereference: x\n", errout.str()); } + void nullpointer9() //#ticket 1778 + { + checkNullPointer("void foo()\n" + "{\n" + " std::string * x = 0;\n" + " *x = \"test\";\n" + "}\n"); + TODO_ASSERT_EQUALS("[test.cpp:4]: (error) Possible null pointer dereference: x\n", errout.str()); + } + void checkUninitVar(const char code[]) { // Tokenize..