From 91011b8450101baa0b423e84ed729fb8b7b4f8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 26 Feb 2009 19:46:59 +0000 Subject: [PATCH] array index out of bounds: Added todo test case TestBufferOverrun::array_index_13 for ticket #118 --- test/testbufferoverrun.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 106ba3e7a..1d48b1273 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -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()); + } + +