astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2019-08-07 08:05:46 +02:00
parent c6c50567cf
commit 9fa1a5a540
1 changed files with 12 additions and 12 deletions

View File

@ -1139,25 +1139,25 @@ private:
void doublefree10() { void doublefree10() {
check("void f(char* s) {\n" check("void f(char* s) {\n"
" char *p = malloc(strlen(s));\n" " char *p = malloc(strlen(s));\n"
" if (p != NULL) {\n" " if (p != NULL) {\n"
" strcat(p, s);\n" " strcat(p, s);\n"
" if (strlen(s) != 10)\n" " if (strlen(s) != 10)\n"
" free(p); p = NULL;\n" " free(p); p = NULL;\n"
" }\n" " }\n"
" if (p != NULL)\n" " if (p != NULL)\n"
" free(p);\n" " free(p);\n"
"}\n", true); "}\n", true);
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
check("void f(char* s) {\n" check("void f(char* s) {\n"
" char *p = malloc(strlen(s));\n" " char *p = malloc(strlen(s));\n"
" if (p != NULL) {\n" " if (p != NULL) {\n"
" strcat(p, s);\n" " strcat(p, s);\n"
" if (strlen(s) != 10)\n" " if (strlen(s) != 10)\n"
" free(p), p = NULL;\n" " free(p), p = NULL;\n"
" }\n" " }\n"
" if (p != NULL)\n" " if (p != NULL)\n"
" free(p);\n" " free(p);\n"
"}\n", true); "}\n", true);
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());