added testcases for testing dangerous functions: mktemp
This commit is contained in:
parent
c76a9525c1
commit
866d66ba78
|
@ -76,6 +76,18 @@ private:
|
||||||
" char *x = mktemp(\"/tmp/zxcv\");\n"
|
" char *x = mktemp(\"/tmp/zxcv\");\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (style) Found 'mktemp'. You should use 'mkstemp' instead\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3]: (style) Found 'mktemp'. You should use 'mkstemp' instead\n", errout.str());
|
||||||
|
|
||||||
|
check("char * f(const std::string& strVal)\n"
|
||||||
|
"{\n"
|
||||||
|
" return(mktemp(strVal.c_str()));\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3]: (style) Found 'mktemp'. You should use 'mkstemp' instead\n", errout.str());
|
||||||
|
|
||||||
|
check("char * f(const std::string& strVal)\n"
|
||||||
|
"{\n"
|
||||||
|
" return mktemp(strVal.c_str()) ;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3]: (style) Found 'mktemp'. You should use 'mkstemp' instead\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void testgets()
|
void testgets()
|
||||||
|
|
Loading…
Reference in New Issue