stl: added todo test case, erasing invalid iterator

This commit is contained in:
Daniel Marjamäki 2009-05-02 20:39:51 +02:00
parent e11449bd58
commit b46777235d
1 changed files with 13 additions and 0 deletions

View File

@ -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> &ints)\n"
"{\n"
" std::vector<int>::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()