re-enable tests in testnullpointer
This commit is contained in:
parent
9ef7bb4525
commit
e04351ec33
|
@ -2080,13 +2080,11 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void nullpointerStdStream() {
|
void nullpointerStdStream() {
|
||||||
// TODO: Refactor these tests and re-enable them
|
|
||||||
#if 0
|
|
||||||
check("void f(std::ifstream& is) {\n"
|
check("void f(std::ifstream& is) {\n"
|
||||||
" char* p = 0;\n"
|
" char* p = 0;\n"
|
||||||
" is >> p;\n"
|
" is >> p;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p\n", errout.str());
|
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p\n", "", errout.str());
|
||||||
|
|
||||||
check("void f(const std::ostringstream& oss, char* q) {\n"
|
check("void f(const std::ostringstream& oss, char* q) {\n"
|
||||||
" char const* p = 0;\n" // Simplification makes detection of bug difficult
|
" char const* p = 0;\n" // Simplification makes detection of bug difficult
|
||||||
|
@ -2095,9 +2093,8 @@ private:
|
||||||
" if(q == 0)\n"
|
" if(q == 0)\n"
|
||||||
" oss << foo << q;\n"
|
" oss << foo << q;\n"
|
||||||
"}", false, "test.cpp", false);
|
"}", false, "test.cpp", false);
|
||||||
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p\n"
|
ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: p\n"
|
||||||
"[test.cpp:4]: (error) Possible null pointer dereference: p\n"
|
"[test.cpp:4]: (error) Possible null pointer dereference: p\n"
|
||||||
"[test.cpp:6] -> [test.cpp:5]: (warning) Possible null pointer dereference: q - otherwise it is redundant to check it against null.\n",
|
|
||||||
"[test.cpp:6] -> [test.cpp:5]: (warning) Possible null pointer dereference: q - otherwise it is redundant to check it against null.\n", errout.str());
|
"[test.cpp:6] -> [test.cpp:5]: (warning) Possible null pointer dereference: q - otherwise it is redundant to check it against null.\n", errout.str());
|
||||||
|
|
||||||
check("void f(const char* p) {\n"
|
check("void f(const char* p) {\n"
|
||||||
|
@ -2135,10 +2132,6 @@ private:
|
||||||
" std::cout << i;\n" // Its no char* (#4240)
|
" std::cout << i;\n" // Its no char* (#4240)
|
||||||
"}", true);
|
"}", true);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
#else
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void functioncall() { // #3443 - function calls
|
void functioncall() { // #3443 - function calls
|
||||||
|
|
Loading…
Reference in New Issue