Skip to content

Commit 1c2b856

Browse files
committed
C++: Remove 'flow' value from testcases
1 parent 5f9b96c commit 1c2b856

File tree

14 files changed

+71
-71
lines changed

14 files changed

+71
-71
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ class A
4040
cc.insert(nullptr);
4141
ct.insert(new C());
4242
sink(&cc); // no flow
43-
sink(&ct); // $ast=flow $f-:ir=flow
43+
sink(&ct); // $ast $f-:ir
4444
}
4545
void f1()
4646
{
4747
C *c = new C();
4848
B *b = B::make(c);
49-
sink(b->c); // $ast=flow $f-:ir=flow
49+
sink(b->c); // $ast $f-:ir
5050
}
5151

5252
void f2()
5353
{
5454
B *b = new B();
5555
b->set(new C1());
56-
sink(b->get()); // $ast=flow $f-:ir=flow
57-
sink((new B(new C()))->get()); // $ast=flow $f-:ir=flow
56+
sink(b->get()); // $ast $f-:ir
57+
sink((new B(new C()))->get()); // $ast $f-:ir
5858
}
5959

6060
void f3()
@@ -63,7 +63,7 @@ class A
6363
B *b2;
6464
b2 = setOnB(b1, new C2());
6565
sink(b1->c); // no flow
66-
sink(b2->c); // $ast=flow $f-:ir=flow
66+
sink(b2->c); // $ast $f-:ir
6767
}
6868

6969
void f4()
@@ -72,7 +72,7 @@ class A
7272
B *b2;
7373
b2 = setOnBWrap(b1, new C2());
7474
sink(b1->c); // no flow
75-
sink(b2->c); // $ast=flow $f-:ir=flow
75+
sink(b2->c); // $ast $f-:ir
7676
}
7777

7878
B *setOnBWrap(B *b1, C *c)
@@ -104,7 +104,7 @@ class A
104104
{
105105
if (C1 *c1 = dynamic_cast<C1 *>(c))
106106
{
107-
sink(c1->a); // $ast=flow $f-:ir=flow
107+
sink(c1->a); // $ast $f-:ir
108108
}
109109
C *cc;
110110
if (C2 *c2 = dynamic_cast<C2 *>(c))
@@ -117,7 +117,7 @@ class A
117117
}
118118
if (C1 *c1 = dynamic_cast<C1 *>(cc))
119119
{
120-
sink(c1->a); //$f+:ast=flow
120+
sink(c1->a); //$f+:ast
121121
}
122122
}
123123

@@ -129,7 +129,7 @@ class A
129129
{
130130
B *b = new B();
131131
f7(b);
132-
sink(b->c); // $ast=flow $f-:ir=flow
132+
sink(b->c); // $ast $f-:ir
133133
}
134134

135135
class D
@@ -149,9 +149,9 @@ class A
149149
{
150150
B *b = new B();
151151
D *d = new D(b, r());
152-
sink(d->b); // $ast=flow 143:25 $ast=flow 150:12 $f-:ir=flow
153-
sink(d->b->c); // $ast=flow $f-:ir=flow
154-
sink(b->c); // $ast,ir=flow
152+
sink(d->b); // $ast=143:25 $ast=150:12 $f-:ir
153+
sink(d->b->c); // $ast $f-:ir
154+
sink(b->c); // $ast,ir
155155
}
156156

157157
void f10()
@@ -162,11 +162,11 @@ class A
162162
MyList *l3 = new MyList(nullptr, l2);
163163
sink(l3->head); // no flow, b is nested beneath at least one ->next
164164
sink(l3->next->head); // no flow
165-
sink(l3->next->next->head); // $ast=flow $f-:ir=flow
165+
sink(l3->next->next->head); // $ast $f-:ir
166166
sink(l3->next->next->next->head); // no flow
167167
for (MyList *l = l3; l != nullptr; l = l->next)
168168
{
169-
sink(l->head); // $ast=flow $f-:ir=flow
169+
sink(l->head); // $ast $f-:ir
170170
}
171171
}
172172

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class B
66
Elem *e = new Elem();
77
Box1 *b1 = new Box1(e, nullptr);
88
Box2 *b2 = new Box2(b1);
9-
sink(b2->box1->elem1); // $ast=flow $f-:ir=flow
9+
sink(b2->box1->elem1); // $ast $f-:ir
1010
sink(b2->box1->elem2); // no flow
1111
}
1212

@@ -16,7 +16,7 @@ class B
1616
Box1 *b1 = new B::Box1(nullptr, e);
1717
Box2 *b2 = new Box2(b1);
1818
sink(b2->box1->elem1); // no flow
19-
sink(b2->box1->elem2); // $ast=flow $f-:ir=flow
19+
sink(b2->box1->elem2); // $ast $f-:ir
2020
}
2121

2222
static void sink(void *o) {}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class C
2626

2727
void func()
2828
{
29-
sink(s1); // $ast=flow $f-:ir=flow
30-
sink(s2); // $f-:ast=flow $f-:ir=flow
31-
sink(s3); // $ast=flow $f-:ir=flow
32-
sink(s4); // $f-:ast=flow $f-:ir=flow
29+
sink(s1); // $ast $f-:ir
30+
sink(s2); // $f-:ast $f-:ir
31+
sink(s3); // $ast $f-:ir
32+
sink(s4); // $f-:ast $f-:ir
3333
}
3434

3535
static void sink(const void *o) {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class D {
1919
};
2020

2121
static void sinkWrap(Box2* b2) {
22-
sink(b2->getBox1()->getElem()); // $ast=flow 28:15 $ast=flow 35:15 $ast=flow 42:15 $ast=flow 49:15 $f-:ir=flow
22+
sink(b2->getBox1()->getElem()); // $ast=28:15 $ast=35:15 $ast=42:15 $ast=49:15 $f-:ir
2323
}
2424

2525
Box2* boxfield;
@@ -61,6 +61,6 @@ class D {
6161

6262
private:
6363
void f5b() {
64-
sink(boxfield->box->elem); // $ast=flow $f-:ir=flow
64+
sink(boxfield->box->elem); // $ast $f-:ir
6565
}
6666
};

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void sink(char *b);
1818

1919
void handlePacket(packet *p)
2020
{
21-
sink(p->data.buffer); // $ast=flow $f-:ir=flow
21+
sink(p->data.buffer); // $ast $f-:ir
2222
}
2323

2424
void f(buf* b)
@@ -28,7 +28,7 @@ void f(buf* b)
2828
argument_source(raw);
2929
argument_source(b->buffer);
3030
argument_source(p.data.buffer);
31-
sink(raw); // $ast=flow $f-:ir=flow
32-
sink(b->buffer); // $ast=flow $f-:ir=flow
31+
sink(raw); // $ast $f-:ir
32+
sink(b->buffer); // $ast $f-:ir
3333
handlePacket(&p);
3434
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ void callSetters() {
2626
referenceSetter(s2);
2727
copySetter(s3);
2828

29-
sink(s1.m1); // $ast,ir=flow
30-
sink(s2.m1); // $ast,ir=flow
29+
sink(s1.m1); // $ast,ir
30+
sink(s2.m1); // $ast,ir
3131
sink(s3.m1); // no flow
3232
}
3333

3434
void assignAfterAlias() {
3535
S s1 = { 0, 0 };
3636
S &ref1 = s1;
3737
ref1.m1 = user_input();
38-
sink(s1.m1); // $f-:ast=flow $ir=flow
38+
sink(s1.m1); // $f-:ast $ir
3939

4040
S s2 = { 0, 0 };
4141
S &ref2 = s2;
4242
s2.m1 = user_input();
43-
sink(ref2.m1); // $f-:ast=flow $ir=flow
43+
sink(ref2.m1); // $f-:ast $ir
4444
}
4545

4646
void assignAfterCopy() {
@@ -59,7 +59,7 @@ void assignBeforeCopy() {
5959
S s2 = { 0, 0 };
6060
s2.m1 = user_input();
6161
S copy2 = s2;
62-
sink(copy2.m1); // $ast,ir=flow
62+
sink(copy2.m1); // $ast,ir
6363
}
6464

6565
struct Wrapper {
@@ -77,18 +77,18 @@ void pointerIntermediate() {
7777
Wrapper w = { { 0, 0 } };
7878
S *s = &w.s;
7979
s->m1 = user_input();
80-
sink(w.s.m1); // $f-:ast=flow $ir=flow
80+
sink(w.s.m1); // $f-:ast $ir
8181
}
8282

8383
void referenceIntermediate() {
8484
Wrapper w = { { 0, 0 } };
8585
S &s = w.s;
8686
s.m1 = user_input();
87-
sink(w.s.m1); // $f-:ast=flow $ir=flow
87+
sink(w.s.m1); // $f-:ast $ir
8888
}
8989

9090
void nestedAssign() {
9191
Wrapper w = { { 0, 0 } };
9292
w.s.m1 = user_input();
93-
sink(w.s.m1); // $ast,ir=flow
93+
sink(w.s.m1); // $ast,ir
9494
}

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ struct S {
4848
void test_setDirectly() {
4949
S s;
5050
s.setDirectly(user_input());
51-
sink(s.getDirectly()); // $ast=flow $f-:ir=flow
51+
sink(s.getDirectly()); // $ast $f-:ir
5252
}
5353

5454
void test_setIndirectly() {
5555
S s;
5656
s.setIndirectly(user_input());
57-
sink(s.getIndirectly()); // $ast=flow $f-:ir=flow
57+
sink(s.getIndirectly()); // $ast $f-:ir
5858
}
5959

6060
void test_setThroughNonMember() {
6161
S s;
6262
s.setThroughNonMember(user_input());
63-
sink(s.getThroughNonMember()); // $ast=flow $f-:ir=flow
63+
sink(s.getThroughNonMember()); // $ast $f-:ir
6464
}
6565

6666
void test_nonMemberSetA() {
6767
S s;
6868
nonMemberSetA(&s, user_input());
69-
sink(nonMemberGetA(&s)); // $ast=flow $f-:ir=flow
69+
sink(nonMemberGetA(&s)); // $ast $f-:ir
7070
}
7171

7272
////////////////////
@@ -107,13 +107,13 @@ void test_outer_with_ptr(Outer *pouter) {
107107
taint_inner_a_ptr(pouter->inner_ptr);
108108
taint_a_ptr(&pouter->a);
109109

110-
sink(outer.inner_nested.a); // $ast,ir=flow
111-
sink(outer.inner_ptr->a); // $ast=flow $f-:ir=flow
112-
sink(outer.a); // $f-:ast=flow $f-:ir=flow
110+
sink(outer.inner_nested.a); // $ast,ir
111+
sink(outer.inner_ptr->a); // $ast $f-:ir
112+
sink(outer.a); // $f-:ast $f-:ir
113113

114-
sink(pouter->inner_nested.a); // $ast,ir=flow
115-
sink(pouter->inner_ptr->a); // $ast=flow $f-:ir=flow
116-
sink(pouter->a); // $f-:ast=flow $f-:ir=flow
114+
sink(pouter->inner_nested.a); // $ast,ir
115+
sink(pouter->inner_ptr->a); // $ast $f-:ir
116+
sink(pouter->a); // $f-:ast $f-:ir
117117
}
118118

119119
void test_outer_with_ref(Outer *pouter) {
@@ -127,11 +127,11 @@ void test_outer_with_ref(Outer *pouter) {
127127
taint_inner_a_ref(*pouter->inner_ptr);
128128
taint_a_ref(pouter->a);
129129

130-
sink(outer.inner_nested.a); // $ast,ir=flow
131-
sink(outer.inner_ptr->a); // $ast=flow $f-:ir=flow
132-
sink(outer.a); // $ast=flow $f-:ir=flow
130+
sink(outer.inner_nested.a); // $ast,ir
131+
sink(outer.inner_ptr->a); // $ast $f-:ir
132+
sink(outer.a); // $ast $f-:ir
133133

134-
sink(pouter->inner_nested.a); // $ast,ir=flow
135-
sink(pouter->inner_ptr->a); // $ast=flow $f-:ir=flow
136-
sink(pouter->a); // $ast=flow $f-:ir=flow
134+
sink(pouter->inner_nested.a); // $ast,ir
135+
sink(pouter->inner_ptr->a); // $ast $f-:ir
136+
sink(pouter->a); // $ast $f-:ir
137137
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ void bar(Outer &b)
4848
// in _some_ access path somewhere in the search. That makes the library conclude
4949
// that there could be flow to `b.inner.f.a_` even when the flow was actually to
5050
// `b.inner.f.b_`.
51-
sink(b.inner.f.a()); // $ast=flow 62:19 $f+:ast=flow 63:19 $ast=flow 64:19 $f+:ast=flow 65:19 $f-:ir=flow
52-
sink(b.inner.f.b()); // $f+:ast=flow 62:19 $ast=flow 63:19 $f+:ast=flow 64:19 $ast=flow 65:19 $f-:ir=flow
51+
sink(b.inner.f.a()); // $ast=62:19 $f+:ast=63:19 $ast=64:19 $f+:ast=65:19 $f-:ir
52+
sink(b.inner.f.b()); // $f+:ast=62:19 $ast=63:19 $f+:ast=64:19 $ast=65:19 $f-:ir
5353
}
5454

5555
void foo()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Foo
2525

2626
void bar(Foo &f)
2727
{
28-
sink(f.a()); //$ast=flow 34:11 $ast=flow 36:11 $f-:ir=flow
29-
sink(f.b()); //$ast=flow 35:14 $ast=flow 36:25 $f-:ir=flow
28+
sink(f.a()); //$ast=34:11 $ast=36:11 $f-:ir
29+
sink(f.b()); //$ast=35:14 $ast=36:25 $f-:ir
3030
}
3131

3232
void foo()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class ASTFieldFlowTest extends InlineExpectationsTest {
4848
conf.hasFlow(source, sink) and
4949
n = strictcount(Node otherSource | conf.hasFlow(otherSource, sink)) and
5050
(
51-
n = 1 and value = "flow"
51+
n = 1 and value = ""
5252
or
5353
// If there is more than one source for this sink
5454
// we specify the source location explicitly.
5555
n > 1 and
5656
value =
57-
"flow " + source.getLocation().getStartLine().toString() + ":" +
57+
source.getLocation().getStartLine().toString() + ":" +
5858
source.getLocation().getStartColumn()
5959
) and
6060
location = sink.getLocation() and

0 commit comments

Comments
 (0)