Error message: Replace " with ' around variable name
This commit is contained in:
parent
682aa57df4
commit
67a1c6817b
|
@ -333,7 +333,7 @@ void CheckMemoryLeak::memleakError(const Token *tok, const std::string &varname)
|
||||||
|
|
||||||
void CheckMemoryLeak::memleakUponReallocFailureError(const Token *tok, const std::string &varname)
|
void CheckMemoryLeak::memleakUponReallocFailureError(const Token *tok, const std::string &varname)
|
||||||
{
|
{
|
||||||
reportErr(tok, Severity::error, "memleakOnRealloc", "Common realloc mistake: \"" + varname + "\" nulled but not freed upon failure");
|
reportErr(tok, Severity::error, "memleakOnRealloc", "Common realloc mistake: \'" + varname + "\' nulled but not freed upon failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckMemoryLeak::resourceLeakError(const Token *tok, const std::string &varname)
|
void CheckMemoryLeak::resourceLeakError(const Token *tok, const std::string &varname)
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ private:
|
||||||
" ;\n"
|
" ;\n"
|
||||||
" free(buf);\n"
|
" free(buf);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:6]: (error) Common realloc mistake: \"buf\" nulled but not freed upon failure\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:6]: (error) Common realloc mistake: \'buf\' nulled but not freed upon failure\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void if11()
|
void if11()
|
||||||
|
@ -1177,7 +1177,7 @@ private:
|
||||||
" return a;\n"
|
" return a;\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
TODO_ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: a\n", errout.str());
|
TODO_ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: a\n", errout.str());
|
||||||
ASSERT_EQUALS("[test.cpp:8]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:8]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1198,7 +1198,7 @@ private:
|
||||||
"\n"
|
"\n"
|
||||||
" return a;\n"
|
" return a;\n"
|
||||||
"}\n", true);
|
"}\n", true);
|
||||||
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1219,7 +1219,7 @@ private:
|
||||||
"\n"
|
"\n"
|
||||||
" return a;\n"
|
" return a;\n"
|
||||||
"}\n", true);
|
"}\n", true);
|
||||||
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n"
|
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n"
|
||||||
"[test.cpp:11]: (error) Memory leak: a\n", errout.str());
|
"[test.cpp:11]: (error) Memory leak: a\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2033,7 +2033,7 @@ private:
|
||||||
" char *a = (char *)malloc(10);\n"
|
" char *a = (char *)malloc(10);\n"
|
||||||
" a = realloc(a, 100);\n"
|
" a = realloc(a, 100);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n"
|
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n"
|
||||||
"[test.cpp:5]: (error) Memory leak: a\n", errout.str());
|
"[test.cpp:5]: (error) Memory leak: a\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2046,7 +2046,7 @@ private:
|
||||||
" free(a);\n"
|
" free(a);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
|
|
||||||
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void realloc3()
|
void realloc3()
|
||||||
|
@ -2073,7 +2073,7 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
|
|
||||||
TODO_ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: a\n", errout.str());
|
TODO_ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: a\n", errout.str());
|
||||||
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \'a\' nulled but not freed upon failure\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void realloc5()
|
void realloc5()
|
||||||
|
|
Loading…
Reference in New Issue