diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-10-18 13:13:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-10-18 13:13:04 +0200 |
commit | 97ef1c0693a925d398d32298f4a2bc8f33a17550 (patch) | |
tree | 4271f301caf3c64c436a9034a5f1fd06f863f34f | |
parent | 46449750b607e7bcbcc9d809a33152b1acce320c (diff) | |
download | curl-97ef1c0693a925d398d32298f4a2bc8f33a17550.tar.gz |
fixup test more checksbagder/test-checksrc
-rw-r--r-- | tests/data/test1185 | 88 |
1 files changed, 81 insertions, 7 deletions
diff --git a/tests/data/test1185 b/tests/data/test1185 index 98fdd7991..47b4f22aa 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -42,7 +42,7 @@ if(a == 2) { moo = 2; } -if(a == 2){ +if(a == 2){ /* followed by comment */ ; } @@ -50,6 +50,35 @@ func() ; a = sprintf(buffer, "%s", moo); +FILE *f = fopen("filename", "r"); + +void startfunc(int a, int b) { + func(); +} + + for(;;) { + func(1); + } while(1); + + char * name = "hello"; + char* name = "hello"; + + int foo=bar; + int foo= bar; + int foo = bar; + int foo = bar;foo++; + for(;;) { + } + + int a = sizeof int; + int a = snprintf(buffer, sizeof(buffer), "%d", 99); + + if(a) b++; + + // CPP comment? + + /* comment doesn't end + </file> </client> @@ -87,21 +116,66 @@ a = sprintf(buffer, "%s", moo); } else { ^ ./log/code1185.c:24:11: warning: missing space after close paren (PARENBRACE) - if(a == 2){ + if(a == 2){ ^ -./log/code1185.c:24:11: warning: wrongly placed open brace (BRACEPOS) - if(a == 2){ - ^ -./log/code1185.c:28:7: warning: space before last semicolon (SPACESEMICOLON) +./log/code1185.c:28:7: warning: no space before semicolon (SPACESEMICOLON) func() ; ^ ./log/code1185.c:30:5: warning: use of sprintf is banned (BANNEDFUNC) a = sprintf(buffer, "%s", moo); ^ +./log/code1185.c:32:11: warning: use of non-binary fopen without FOPEN_* macro: r (FOPENMODE) + FILE *f = fopen("filename", "r"); + ^ +./log/code1185.c:34:30: warning: wrongly placed open brace (BRACEPOS) + void startfunc(int a, int b) { + ^ +./log/code1185.c:39:6: warning: not indented 2 steps (uses 4) (INDENTATION) + func(1); + ^ +./log/code1185.c:42:8: warning: space after declarative asterisk (ASTERISKSPACE) + char * name = "hello"; + ^ +./log/code1185.c:43:7: warning: space after declarative asterisk (ASTERISKSPACE) + char* name = "hello"; + ^ +./log/code1185.c:43:6: warning: no space before asterisk (ASTERISKNOSPACE) + char* name = "hello"; + ^ +./log/code1185.c:45:10: warning: no space after equals sign (EQUALSNOSPACE) + int foo=bar; + ^ +./log/code1185.c:46:9: warning: no space before equals sign (NOSPACEEQUALS) + int foo= bar; + ^ +./log/code1185.c:48:16: warning: no space after semicolon (SEMINOSPACE) + int foo = bar;foo++; + ^ +./log/code1185.c:49:10: warning: multiple spaces (MULTISPACE) + for(;;) { + ^ +./log/code1185.c:50:2: warning: not indented 2 steps (uses 0) (INDENTATION) + } + ^ +./log/code1185.c:52:16: warning: sizeof without parenthesis (SIZEOFNOPAREN) + int a = sizeof int; + ^ +./log/code1185.c:53:10: warning: use of snprintf is banned (SNPRINTF) + int a = snprintf(buffer, sizeof(buffer), "%d", 99); + ^ +./log/code1185.c:55:7: warning: conditional block on the same line (ONELINECONDITION) + if(a) b++; + ^ +./log/code1185.c:57:2: warning: // comment (CPPCOMMENTS) + // CPP comment? + ^ ./log/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT) ^ -checksrc: 0 errors and 15 warnings +./log/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT) + + ^ +checksrc: 0 errors and 30 warnings </stdout> <errorcode> 5 |