Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa02042

Browse files
author
Robert Marsh
committed
C++: add more tests and rename test functions
1 parent 64ed930 commit fa02042

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| 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 |
2-
| 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 |
3-
| 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 |
1+
| 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 |
2+
| 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 |
3+
| 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 |
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
void foo();
2-
void bar(void);
3-
void baz(int);
1+
void declared_empty();
2+
void declared_void(void);
3+
void declared_with(int);
4+
void declared_empty_defined_with();
45

56
void test() {
6-
foo(); // GOOD
7-
foo(1); // BAD
8-
bar(); // GOOD
9-
baz(1); // GOOD
7+
declared_empty(); // GOOD
8+
declared_empty(1); // BAD
9+
declared_void(); // GOOD
10+
declared_with(1); // GOOD
1011

1112
undeclared(1); // GOOD
1213

1314
not_yet_declared1(1); // BAD
1415
not_yet_declared2(1); // GOOD
16+
17+
declared_empty_defined_with(); // BAD
18+
declared_empty_defined_with(1); // GOOD
19+
20+
int x;
21+
declared_empty_defined_with(&x); // BAD
22+
declared_empty_defined_with(x, x); // BAD
1523
}
1624

1725
void not_yet_declared1();
18-
void not_yet_declared2(int);
26+
void not_yet_declared2(int);
27+
void declared_empty_defined_with(int x) {
28+
// do nothing
29+
}

0 commit comments

Comments
 (0)