Skip to content

Commit 02835ab

Browse files
committed
qltests: Update inline expectations.
1 parent 96f96d5 commit 02835ab

166 files changed

Lines changed: 827 additions & 828 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-476/semmle/tests/test.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ void funcWork1b() {
6060

6161
}
6262
catch (...)
63-
{
63+
{ // $ Alert
6464
for (size_t i = 0; i < 10; i++)
6565
{
6666
delete[] bufMyData[i]->buffer; // BAD
6767
delete bufMyData[i];
6868
}
6969
delete [] bufMyData;
7070

71-
} // $ Alert
71+
}
7272
}
7373

7474
void funcWork1() {
@@ -88,7 +88,7 @@ void funcWork1() {
8888

8989
}
9090
catch (...)
91-
{
91+
{ // $ Alert
9292
for (size_t i = 0; i < 10; i++)
9393
{
9494
if (bufMyData[i])
@@ -97,7 +97,7 @@ void funcWork1() {
9797
}
9898
delete [] bufMyData;
9999

100-
} // $ Alert
100+
}
101101
}
102102

103103
void funcWork2() {
@@ -117,15 +117,15 @@ void funcWork2() {
117117

118118
}
119119
catch (...)
120-
{
120+
{ // $ Alert
121121
for (size_t i = 0; i < 10; i++)
122122
{
123123
delete[] bufMyData[i]->buffer; // BAD
124124
delete bufMyData[i];
125125
}
126126
delete [] bufMyData;
127127

128-
} // $ Alert
128+
}
129129
}
130130
void funcWork3() {
131131
int a;
@@ -140,15 +140,15 @@ void funcWork3() {
140140

141141
}
142142
catch (...)
143-
{
143+
{ // $ Alert
144144
for (size_t i = 0; i < 10; i++)
145145
{
146146
delete[] bufMyData[i]->buffer; // BAD
147147
delete bufMyData[i];
148148
}
149149
delete [] bufMyData;
150150

151-
} // $ Alert
151+
}
152152
}
153153

154154

@@ -178,9 +178,9 @@ void funcWork4b() {
178178
throwFunction(a);
179179
}
180180
catch (...)
181-
{
181+
{ // $ Alert
182182
delete valData; // BAD
183-
} // $ Alert
183+
}
184184
}
185185
void funcWork5() {
186186
int a;
@@ -216,9 +216,9 @@ void funcWork5b() {
216216
throw;
217217
}
218218
catch (...)
219-
{
219+
{ // $ Alert
220220
delete valData; // BAD
221-
} // $ Alert
221+
}
222222
}
223223
void funcWork6() {
224224
int a;

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-561/semmle/tests/test.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ void testFunction(char c1,int i1)
1717
case 9:
1818
}
1919
}
20-
switch(c1){ // BAD
20+
switch(c1){ // BAD // $ Alert
2121
case 12:
2222
break;
2323
case 10:
2424
break;
2525
case 9:
2626
break;
2727
dafault:
28-
} // $ Alert
28+
}
2929

30-
switch(c1){ // BAD
30+
switch(c1){ // BAD // $ Alert
3131
c1=c1*2;
3232
case 12:
3333
break;
3434
case 10:
3535
break;
3636
case 9:
3737
break;
38-
} // $ Alert
38+
}
3939

4040
if((c1<6)&&(c1>0))
41-
switch(c1){ // BAD
41+
switch(c1){ // BAD // $ Alert
4242
case 8:
4343
break;
4444
case 5:
@@ -47,14 +47,14 @@ void testFunction(char c1,int i1)
4747
break;
4848
case 1:
4949
break;
50-
} // $ Alert
50+
}
5151

5252
if((c1<6)&&(c1>0))
53-
switch(c1){ // BAD
53+
switch(c1){ // BAD // $ Alert
5454
case 3:
5555
break;
5656
case 1:
5757
break;
58-
} // $ Alert
58+
}
5959

6060
}

cpp/ql/test/query-tests/Architecture/Refactoring Opportunities/ClassesWithManyFields/cwmf.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#define int_g(n) int g##n;
66

77
struct aa {
8-
TEN(int_f)
9-
TEN(int_g) // $ Alert
8+
TEN(int_f) // $ Alert
9+
TEN(int_g)
1010
};
1111

1212
class bb {
13-
TEN(int_f)
14-
TEN(int_g) // $ Alert
13+
TEN(int_f) // $ Alert
14+
TEN(int_g)
1515
};
1616

1717
union cc_not_flagged_up_because_unions_are_not_classes_in_this_sense {
@@ -21,14 +21,14 @@ union cc_not_flagged_up_because_unions_are_not_classes_in_this_sense {
2121

2222
template <typename T>
2323
struct dd {
24-
TEN(int_f)
25-
TEN(int_g) // $ Alert
24+
TEN(int_f) // $ Alert
25+
TEN(int_g)
2626
};
2727

2828
template <typename U>
2929
struct ee {
30-
TEN(int_f)
31-
TEN(int_g) // $ Alert
30+
TEN(int_f) // $ Alert
31+
TEN(int_g)
3232
};
3333

3434
void instantiate() {
@@ -38,7 +38,7 @@ void instantiate() {
3838

3939
// from the qhelp (30 fields)
4040
struct MyParticle {
41-
bool isActive;
41+
bool isActive; // $ Alert
4242
int priority;
4343

4444
float x, y, z;
@@ -54,7 +54,7 @@ struct MyParticle {
5454
unsigned char r2, g2, b2, a2;
5555

5656
class texture *tex;
57-
float u1, v1, u2, v2; // $ Alert
57+
float u1, v1, u2, v2;
5858
};
5959

6060
struct MyAlphaClass1 { // $ Alert

cpp/ql/test/query-tests/Architecture/Refactoring Opportunities/ClassesWithManyFields/different_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DifferentTypes {
1212
};
1313

1414
class DifferentTypes2 {
15-
SOME_TYPE i1;
15+
SOME_TYPE i1; // $ Alert
1616
SOME_TYPE i2;
1717
SOME_TYPE i3;
1818
SOME_TYPE i4;
@@ -30,6 +30,6 @@ class DifferentTypes2 {
3030
int j6;
3131
int j7;
3232
int j8;
33-
int j9; // $ Alert
33+
int j9;
3434
};
3535

cpp/ql/test/query-tests/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ int Foo::test(int (*baz)(int))
173173

174174
if (foo(j))
175175
return i++
176-
, i++ // GOOD(?) [FALSE POSITIVE] -- can't exclude w/o source code text :/
176+
, i++ // GOOD(?) [FALSE POSITIVE] -- can't exclude w/o source code text :/ // $ SPURIOUS: Alert
177177
? 1
178-
: 2; // $ SPURIOUS: Alert
178+
: 2;
179179

180180
int quux =
181181
(tata->titi.tutu(),

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/inconsistentLoopDirection/inconsistentLoopDirection.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ void Signed()
22
{
33
signed char i;
44

5-
for (i = 0; i < 100; i--) //BUG
5+
for (i = 0; i < 100; i--) //BUG // $ Alert
66
{
7-
} // $ Alert
7+
}
88

99
for (i = 0; i < 100; i++)
1010
{
1111
}
1212

13-
for (i = 100; i >= 0; i++) //BUG
13+
for (i = 100; i >= 0; i++) //BUG // $ Alert
1414
{
15-
} // $ Alert
15+
}
1616

1717
for (i = 100; i >= 0; i--)
1818
{
@@ -24,17 +24,17 @@ void Unsigned()
2424
{
2525
unsigned long i;
2626

27-
for (i = 0; i < 100; i--) //BUG
27+
for (i = 0; i < 100; i--) //BUG // $ Alert
2828
{
29-
} // $ Alert
29+
}
3030

3131
for (i = 0; i < 100; i++)
3232
{
3333
}
3434

35-
for (i = 100; i >= 0; i++) //BUG
35+
for (i = 100; i >= 0; i++) //BUG // $ Alert
3636
{
37-
} // $ Alert
37+
}
3838

3939
for (i = 100; i >= 0; i--)
4040
{
@@ -45,19 +45,19 @@ void InitializationOutsideLoop()
4545
{
4646
signed char i = 0;
4747

48-
for (; i < 100; i--) //BUG
48+
for (; i < 100; i--) //BUG // $ Alert
4949
{
50-
} // $ Alert
50+
}
5151

5252
i = 0;
5353
for (; i < 100; i++)
5454
{
5555
}
5656

5757
i = 100;
58-
for (; i >= 0; i++) //BUG
58+
for (; i >= 0; i++) //BUG // $ Alert
5959
{
60-
} // $ Alert
60+
}
6161

6262
i = 100;
6363
for (; i >= 0; i--)

0 commit comments

Comments
 (0)