stl: added todo test case, invalid iterator after insert

This commit is contained in:
Daniel Marjamäki 2009-05-02 20:49:58 +02:00
parent b46777235d
commit 50567c164f
1 changed files with 16 additions and 0 deletions

View File

@ -54,6 +54,8 @@ private:
TEST_CASE(pushback3); TEST_CASE(pushback3);
TEST_CASE(pushback4); TEST_CASE(pushback4);
TEST_CASE(insert1);
TEST_CASE(invalidcode); TEST_CASE(invalidcode);
TEST_CASE(stlBoundries1); TEST_CASE(stlBoundries1);
@ -335,6 +337,20 @@ private:
void insert1()
{
check("void f(std::vector<int> &ints)\n"
"{\n"
" std::vector<int>::iterator iter = ints.begin() + 5;\n"
" ints.insert(ints.begin(), 1);\n"
" ++iter;\n"
"}\n");
TODO_ASSERT_EQUALS("[test.cpp:7]: (error) Invalid iterator 'iter' after insert\n", errout.str());
}
void invalidcode() void invalidcode()
{ {
check("void f()\n" check("void f()\n"