Skip to content

Commit b1e7649

Browse files
committed
CPP: Add functions containing errors to the sideEffects tests.
1 parent 3c00d4b commit b1e7649

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// semmle-extractor-options: --expect_errors
2+
3+
void functionBeforeError()
4+
{
5+
}
6+
7+
void functionWithError1()
8+
{
9+
aaaaaaaaaa(); // error
10+
}
11+
12+
void functionWithError2()
13+
{
14+
int i = aaaaaaaaaa(); // error
15+
}
16+
17+
void functionAfterError()
18+
{
19+
}

cpp/ql/test/library-tests/sideEffects/functions/sideEffects.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
| cpp.cpp:87:5:87:26 | functionAccessesStatic | int | false |
4444
| cpp.cpp:93:6:93:14 | increment | int & -> void | false |
4545
| cpp.cpp:97:6:97:16 | doIncrement | void | false |
46+
| error.cpp:3:6:3:24 | functionBeforeError | void | true |
47+
| error.cpp:7:6:7:23 | functionWithError1 | void | false |
48+
| error.cpp:12:6:12:23 | functionWithError2 | void | false |
49+
| error.cpp:17:6:17:23 | functionAfterError | void | true |
4650
| file://:0:0:0:0 | operator= | __va_list_tag & | false |
4751
| file://:0:0:0:0 | operator= | __va_list_tag & | false |
4852
| sideEffects.c:4:5:4:6 | f1 | int | true |

0 commit comments

Comments
 (0)