From b46777235d7bd4a1875b386cc330b19bce6c1ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 2 May 2009 20:39:51 +0200 Subject: [PATCH] stl: added todo test case, erasing invalid iterator --- test/teststl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/teststl.cpp b/test/teststl.cpp index 8f08c0edf..c10337188 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -47,6 +47,7 @@ private: TEST_CASE(eraseGoto); TEST_CASE(eraseAssign); TEST_CASE(eraseDereference); + TEST_CASE(eraseErase); TEST_CASE(pushback1); TEST_CASE(pushback2); @@ -267,6 +268,18 @@ private: TODO_ASSERT_EQUALS("[test.cpp:6]: (error) Dereferencing invalid iterator\n", errout.str()); } + void eraseErase() + { + check("void f(std::vector &ints)\n" + "{\n" + " std::vector::iterator iter;\n" + " iter = ints.begin() + 2;\n" + " ints.erase(iter);\n" + " ints.erase(iter);\n" + "}\n"); + TODO_ASSERT_EQUALS("[test.cpp:6]: (error) Erasing invalid iterator\n", errout.str()); + } + void pushback1()