diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index b112e5c1c..a70c98232 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -673,7 +673,7 @@ private: "static void f()\n" "{\n" " char str[5];\n" - " memclr( str ); // ERROR\n" + " memclr( str );\n" "}\n"); ASSERT_EQUALS("[test.cpp:9] -> [test.cpp:3]: (error) Array 'str[5]' accessed at index 10, which is out of bounds.\n", errout.str()); @@ -685,7 +685,7 @@ private: "static void f()\n" "{\n" " char str[5];\n" - " memclr( 0, str ); // ERROR\n" + " memclr( 0, str );\n" "}\n"); ASSERT_EQUALS("[test.cpp:9] -> [test.cpp:3]: (error) Array 'str[5]' accessed at index 10, which is out of bounds.\n", errout.str()); @@ -697,7 +697,7 @@ private: "static void f()\n" "{\n" " char str[5];\n" - " memclr( 10, str ); // ERROR\n" + " memclr( 10, str );\n" "}\n"); TODO_ASSERT_EQUALS("[test.cpp:9] -> [test.cpp:3]: (possible error) Array index out of bounds.\n", "", errout.str()); @@ -712,7 +712,7 @@ private: "static void f()\n" "{\n" " char str[5];\n" - " memclr( str, 5 ); // ERROR\n" + " memclr( str, 5 );\n" "}\n"); ASSERT_EQUALS("", errout.str()); diff --git a/test/testclass.cpp b/test/testclass.cpp index 1962d217c..2fd7f719c 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -4104,7 +4104,7 @@ private: " std::map _hash;\n" " public:\n" " A() : _hash() {}\n" - " unsigned int fetch(unsigned int key) // cannot be 'const'\n" + " unsigned int fetch(unsigned int key)\n" // cannot be 'const' " {\n" " return _hash[key];\n" " }\n" diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 1d7205c6e..1390a7bc0 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -3730,19 +3730,14 @@ private: } void trac1949() { - check("\n" - "\n" - "int fn()\n" + check("int fn()\n" "{\n" - "char * buff = new char[100];\n" - "assert (buff);\n" - "\n" - "\n" - "\n" - "return 0;\n" - "}\n" + " char * buff = new char[100];\n" + " assert (buff);\n" + " return 0;\n" + "}" ); - ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: buff\n", errout.str()); + ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: buff\n", errout.str()); } void trac2540() { diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 16c65aae5..0e6921378 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -1489,24 +1489,24 @@ private: void localvar44() { // ticket #3602 (false positive) functionVariableUsage("void bar()\n" - "{ \n" + "{\n" " int * piArray = NULL;\n" " unsigned int uiArrayLength = 2048;\n" " unsigned int uiIndex;\n" - " // Allocate memory\n" + "\n" " try\n" " {\n" - " piArray = new int[uiArrayLength];\n" + " piArray = new int[uiArrayLength];\n" // Allocate memory " }\n" " catch (...)\n" " {\n" - " SOME_MACRO\n" - " delete [] piArray;\n" - " return;\n" + " SOME_MACRO\n" + " delete [] piArray;\n" + " return;\n" " }\n" " for (uiIndex = 0; uiIndex < uiArrayLength; uiIndex++)\n" " {\n" - " piArray[uiIndex] = -1234;\n" + " piArray[uiIndex] = -1234;\n" " }\n" " delete [] piArray;\n" " piArray = NULL;\n"