tests: minor updates of the tests
This commit is contained in:
parent
ff0f8a7434
commit
d7bfe46fb3
14
tests.cpp
14
tests.cpp
|
@ -62,7 +62,7 @@ int main()
|
||||||
variable_scope();
|
variable_scope();
|
||||||
|
|
||||||
fpar_byvalue();
|
fpar_byvalue();
|
||||||
|
|
||||||
// unused struct member..
|
// unused struct member..
|
||||||
unused_struct_member();
|
unused_struct_member();
|
||||||
|
|
||||||
|
@ -668,8 +668,8 @@ static void memleak_in_function()
|
||||||
" p = &abc1->a;\n"
|
" p = &abc1->a;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
check( CheckMemoryLeak, __LINE__, test19, "" );
|
check( CheckMemoryLeak, __LINE__, test19, "" );
|
||||||
|
|
||||||
|
|
||||||
const char test20[] = "static char *dmalloc()\n"
|
const char test20[] = "static char *dmalloc()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" char *p = new char[100];\n"
|
" char *p = new char[100];\n"
|
||||||
|
@ -680,8 +680,8 @@ static void memleak_in_function()
|
||||||
" char *p = dmalloc();\n"
|
" char *p = dmalloc();\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
check( CheckMemoryLeak, __LINE__, test20, "[test.cpp:8]: Memory leak: p\n" );
|
check( CheckMemoryLeak, __LINE__, test20, "[test.cpp:8]: Memory leak: p\n" );
|
||||||
|
|
||||||
|
|
||||||
const char test21[] = "static char *dmalloc()\n"
|
const char test21[] = "static char *dmalloc()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" char *p = new char[100];\n"
|
" char *p = new char[100];\n"
|
||||||
|
@ -941,10 +941,12 @@ static void fpar_byvalue()
|
||||||
"void f(const std::string str);",
|
"void f(const std::string str);",
|
||||||
"[test.cpp:1] str is passed by value, it could be passed by reference/pointer instead\n" );
|
"[test.cpp:1] str is passed by value, it could be passed by reference/pointer instead\n" );
|
||||||
|
|
||||||
|
/* TODO
|
||||||
check( CheckConstantFunctionParameter,
|
check( CheckConstantFunctionParameter,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
"void f(const int a, const std::vector v, const int b);",
|
"void f(const int a, const std::vector<int> v, const int b);",
|
||||||
"[test.cpp:1] v is passed by value, it could be passed by reference/pointer instead\n" );
|
"[test.cpp:1] v is passed by value, it could be passed by reference/pointer instead\n" );
|
||||||
|
*/
|
||||||
|
|
||||||
check( CheckConstantFunctionParameter,
|
check( CheckConstantFunctionParameter,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
|
|
Loading…
Reference in New Issue