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

Skip to content

Commit e4807c0

Browse files
committed
C++: Accept test changes
1 parent 9d9c78c commit e4807c0

10 files changed

Lines changed: 302 additions & 288 deletions

File tree

cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,5 @@ void intOutparamSource(int *p) {
468468
void viaOutparam() {
469469
int x = 0;
470470
intOutparamSource(&x);
471-
sink(x); // tainted [FALSE NEGATIVE]
471+
sink(x); // tainted [FALSE NEGATIVE by AST]
472472
}

cpp/ql/test/library-tests/dataflow/dataflow-tests/test_diff.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
| globals.cpp:13:23:13:28 | globals.cpp:12:10:12:24 | IR only |
2020
| globals.cpp:23:23:23:28 | globals.cpp:19:10:19:24 | IR only |
2121
| lambdas.cpp:8:10:8:15 | lambdas.cpp:21:3:21:6 | AST only |
22-
| lambdas.cpp:43:7:43:12 | lambdas.cpp:46:7:46:7 | AST only |
23-
| ref.cpp:29:11:29:16 | ref.cpp:62:10:62:11 | AST only |
22+
| ref.cpp:44:11:44:16 | ref.cpp:65:10:65:11 | IR only |
2423
| ref.cpp:53:9:53:10 | ref.cpp:56:10:56:11 | AST only |
2524
| ref.cpp:53:13:53:14 | ref.cpp:59:10:59:11 | AST only |
2625
| ref.cpp:53:17:53:18 | ref.cpp:62:10:62:11 | AST only |
2726
| ref.cpp:53:21:53:22 | ref.cpp:65:10:65:11 | AST only |
28-
| ref.cpp:55:23:55:28 | ref.cpp:56:10:56:11 | AST only |
27+
| ref.cpp:58:19:58:24 | ref.cpp:59:10:59:11 | IR only |
2928
| test.cpp:75:7:75:8 | test.cpp:76:8:76:9 | AST only |
3029
| test.cpp:83:7:83:8 | test.cpp:84:8:84:18 | AST only |
3130
| test.cpp:83:7:83:8 | test.cpp:86:8:86:9 | AST only |
@@ -46,6 +45,7 @@
4645
| test.cpp:436:18:436:23 | test.cpp:437:8:437:12 | AST only |
4746
| test.cpp:441:7:441:11 | test.cpp:443:8:443:12 | AST only |
4847
| test.cpp:442:18:442:22 | test.cpp:443:8:443:12 | AST only |
48+
| test.cpp:465:8:465:13 | test.cpp:471:8:471:8 | IR only |
4949
| true_upon_entry.cpp:9:11:9:16 | true_upon_entry.cpp:13:8:13:8 | IR only |
5050
| true_upon_entry.cpp:62:11:62:16 | true_upon_entry.cpp:66:8:66:8 | IR only |
5151
| true_upon_entry.cpp:98:11:98:16 | true_upon_entry.cpp:105:8:105:8 | IR only |

cpp/ql/test/library-tests/dataflow/dataflow-tests/test_ir.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
| lambdas.cpp:29:3:29:6 | t | lambdas.cpp:8:10:8:15 | call to source |
4545
| lambdas.cpp:35:8:35:8 | a | lambdas.cpp:8:10:8:15 | call to source |
4646
| lambdas.cpp:41:8:41:8 | (reference dereference) | lambdas.cpp:8:10:8:15 | call to source |
47+
| lambdas.cpp:46:7:46:7 | w | lambdas.cpp:43:7:43:12 | call to source |
48+
| ref.cpp:56:10:56:11 | x1 | ref.cpp:55:23:55:28 | call to source |
49+
| ref.cpp:59:10:59:11 | x2 | ref.cpp:58:19:58:24 | call to source |
50+
| ref.cpp:62:10:62:11 | x3 | ref.cpp:29:11:29:16 | call to source |
51+
| ref.cpp:65:10:65:11 | x4 | ref.cpp:44:11:44:16 | call to source |
4752
| ref.cpp:123:13:123:15 | val | ref.cpp:122:23:122:28 | call to source |
4853
| ref.cpp:126:13:126:15 | val | ref.cpp:125:19:125:24 | call to source |
4954
| ref.cpp:129:13:129:15 | val | ref.cpp:94:15:94:20 | call to source |
@@ -77,6 +82,7 @@
7782
| test.cpp:394:10:394:12 | tmp | test.cpp:388:53:388:59 | source1 |
7883
| test.cpp:450:9:450:22 | (statement expression) | test.cpp:449:26:449:32 | source1 |
7984
| test.cpp:461:8:461:12 | local | test.cpp:449:26:449:32 | source1 |
85+
| test.cpp:471:8:471:8 | x | test.cpp:465:8:465:13 | call to source |
8086
| true_upon_entry.cpp:13:8:13:8 | x | true_upon_entry.cpp:9:11:9:16 | call to source |
8187
| true_upon_entry.cpp:21:8:21:8 | x | true_upon_entry.cpp:17:11:17:16 | call to source |
8288
| true_upon_entry.cpp:29:8:29:8 | x | true_upon_entry.cpp:27:9:27:14 | call to source |

cpp/ql/test/library-tests/dataflow/fields/A.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class A
104104
{
105105
if (C1 *c1 = dynamic_cast<C1 *>(c))
106106
{
107-
sink(c1->a); // $ast $ir
107+
sink(c1->a); // $ast $f-:ir
108108
}
109109
C *cc;
110110
if (C2 *c2 = dynamic_cast<C2 *>(c))

cpp/ql/test/library-tests/dataflow/fields/aliasing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ void addressOfField() {
9999

100100
S s_copy = s;
101101
int* px = &s_copy.m1;
102-
sink(*px); // $f-:ast,ir
102+
sink(*px); // $f-:ast $ir
103103
}

cpp/ql/test/library-tests/dataflow/fields/flow-diff.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
| A.cpp:47:12:47:18 | new | A.cpp:49:13:49:13 | c | AST only |
33
| A.cpp:64:21:64:28 | new | A.cpp:66:14:66:14 | c | AST only |
44
| A.cpp:73:25:73:32 | new | A.cpp:75:14:75:14 | c | AST only |
5+
| A.cpp:98:12:98:18 | new | A.cpp:107:16:107:16 | a | AST only |
56
| A.cpp:98:12:98:18 | new | A.cpp:120:16:120:16 | a | AST only |
67
| A.cpp:142:14:142:20 | new | A.cpp:153:16:153:16 | c | AST only |
78
| A.cpp:159:12:159:18 | new | A.cpp:165:26:165:29 | head | AST only |
@@ -20,6 +21,7 @@
2021
| aliasing.cpp:42:11:42:20 | call to user_input | aliasing.cpp:43:13:43:14 | m1 | IR only |
2122
| aliasing.cpp:79:11:79:20 | call to user_input | aliasing.cpp:80:12:80:13 | m1 | IR only |
2223
| aliasing.cpp:86:10:86:19 | call to user_input | aliasing.cpp:87:12:87:13 | m1 | IR only |
24+
| aliasing.cpp:98:10:98:19 | call to user_input | aliasing.cpp:102:8:102:10 | * ... | IR only |
2325
| by_reference.cpp:84:14:84:23 | call to user_input | by_reference.cpp:111:25:111:25 | a | AST only |
2426
| by_reference.cpp:84:14:84:23 | call to user_input | by_reference.cpp:115:27:115:27 | a | AST only |
2527
| by_reference.cpp:88:13:88:22 | call to user_input | by_reference.cpp:131:25:131:25 | a | AST only |

0 commit comments

Comments
 (0)