mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: add more tests and rename test functions
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
| test.c:7:3:7:5 | call to foo | This call has arguments, but $@ is not declared with any parameters. | test.c:1:6:1:8 | foo | foo |
|
||||
| test.c:13:3:13:19 | call to not_yet_declared1 | This call has arguments, but $@ is not declared with any parameters. | test.c:13:3:13:3 | not_yet_declared1 | not_yet_declared1 |
|
||||
| test.c:13:3:13:19 | call to not_yet_declared1 | This call has arguments, but $@ is not declared with any parameters. | test.c:17:6:17:22 | not_yet_declared1 | not_yet_declared1 |
|
||||
| test.c:8:3:8:16 | call to declared_empty | This call has arguments, but $@ is not declared with any parameters. | test.c:1:6:1:19 | declared_empty | declared_empty |
|
||||
| test.c:14:3:14:19 | call to not_yet_declared1 | This call has arguments, but $@ is not declared with any parameters. | test.c:14:3:14:3 | not_yet_declared1 | not_yet_declared1 |
|
||||
| test.c:14:3:14:19 | call to not_yet_declared1 | This call has arguments, but $@ is not declared with any parameters. | test.c:25:6:25:22 | not_yet_declared1 | not_yet_declared1 |
|
||||
|
||||
@@ -1,18 +1,29 @@
|
||||
void foo();
|
||||
void bar(void);
|
||||
void baz(int);
|
||||
void declared_empty();
|
||||
void declared_void(void);
|
||||
void declared_with(int);
|
||||
void declared_empty_defined_with();
|
||||
|
||||
void test() {
|
||||
foo(); // GOOD
|
||||
foo(1); // BAD
|
||||
bar(); // GOOD
|
||||
baz(1); // GOOD
|
||||
declared_empty(); // GOOD
|
||||
declared_empty(1); // BAD
|
||||
declared_void(); // GOOD
|
||||
declared_with(1); // GOOD
|
||||
|
||||
undeclared(1); // GOOD
|
||||
|
||||
not_yet_declared1(1); // BAD
|
||||
not_yet_declared2(1); // GOOD
|
||||
|
||||
declared_empty_defined_with(); // BAD
|
||||
declared_empty_defined_with(1); // GOOD
|
||||
|
||||
int x;
|
||||
declared_empty_defined_with(&x); // BAD
|
||||
declared_empty_defined_with(x, x); // BAD
|
||||
}
|
||||
|
||||
void not_yet_declared1();
|
||||
void not_yet_declared2(int);
|
||||
void not_yet_declared2(int);
|
||||
void declared_empty_defined_with(int x) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user