From 15da4fe689578390b1de27d31c368c8d11fe217e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 10 Apr 2010 18:50:28 +0200 Subject: [PATCH] Refactoring: simplified test case --- test/testbufferoverrun.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 9bf1004b5..5d378649f 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -398,11 +398,10 @@ private: "\n" "static void f()\n" "{\n" - " int datasize = 10;\n" - " struct ABC* x = (struct ABC *)malloc(sizeof(struct ABC) + datasize - 1);\n" - " x->str[1] = 0;" + " struct ABC* x = (struct ABC *)malloc(sizeof(struct ABC) + 10);\n" + " x->str[1] = 0;" "}\n"); - ASSERT_EQUALS("[test.cpp:10]: (possible error) Array 'str[1]' index 1 out of bounds\n", errout.str()); + ASSERT_EQUALS("[test.cpp:9]: (possible error) Array 'str[1]' index 1 out of bounds\n", errout.str()); TODO_ASSERT_EQUALS("", errout.str()); }