stl: added todo test case, erasing invalid iterator
This commit is contained in:
parent
e11449bd58
commit
b46777235d
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue