array index out of bounds: Added todo test case TestBufferOverrun::array_index_13 for ticket #118

This commit is contained in:
Daniel Marjamäki 2009-02-26 19:46:59 +00:00
parent 4296548129
commit 91011b8450
1 changed files with 16 additions and 0 deletions

View File

@ -82,6 +82,7 @@ private:
TEST_CASE(array_index_10);
TEST_CASE(array_index_11);
TEST_CASE(array_index_12);
// TODO TEST_CASE(array_index_13); ticket #118
TEST_CASE(buffer_overrun_1);
TEST_CASE(buffer_overrun_2);
@ -381,6 +382,21 @@ private:
}
void array_index_13()
{
check("typedef unsigned char U8;\n"
"typedef unsigned long U32;\n"
"\n"
"void foo()\n"
"{\n"
" U32 data[21];\n"
" memory[pos++] = (U8) data[2];\n"
" sprintf( buf2, \" %s = V%d\n\", outputIO[data[0]], data[2] );\n"
"}\n");
ASSERT_EQUALS(std::string(""), errout.str());
}