From e2ef26cb2e61c591cbb68c4612c7999e0adb1e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 18 Sep 2010 20:08:34 +0200 Subject: [PATCH] STL: added TODO test case --- test/teststl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/teststl.cpp b/test/teststl.cpp index 52736cfa1..555a5dee6 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -532,6 +532,23 @@ private: " }\n" "}\n"); ASSERT_EQUALS("", errout.str()); + + check("void f()\n" + "{\n" + " std::vector foo;\n" + " std::vector::iterator it;\n" + " for (it = foo.begin(); it != foo.end(); ++it)\n" + " {\n" + " if (somecondition) {\n" + " if (*it == 1)\n" + " foo.erase(it);\n" + " else\n" + " *it = 0;\n" + " }\n" + " }\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); + TODO_ASSERT_EQUALS("[test.cpp:5] (error) Dereferencing invalid iterator 'it'", errout.str()); } void eraseGoto()