Skip to content

Commit 41a5dc8

Browse files
committed
C++: Restrict tests that report all Elements to Elements in files.
1 parent bb27ba7 commit 41a5dc8

File tree

6 files changed

+5
-122
lines changed

6 files changed

+5
-122
lines changed

cpp/ql/test/library-tests/CPP-205/elements.expected

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,3 @@
2626
| CPP-205.cpp:8:3:8:15 | return ... | |
2727
| CPP-205.cpp:8:10:8:11 | call to fn | |
2828
| CPP-205.cpp:8:13:8:13 | 0 | |
29-
| file://:0:0:0:0 | (unnamed parameter 0) | parameter for __va_list_tag& __va_list_tag::operator=(__va_list_tag const&) |
30-
| file://:0:0:0:0 | (unnamed parameter 0) | parameter for __va_list_tag& __va_list_tag::operator=(__va_list_tag&&) |
31-
| file://:0:0:0:0 | __super | |
32-
| file://:0:0:0:0 | __va_list_tag | |
33-
| file://:0:0:0:0 | operator= | function __va_list_tag& __va_list_tag::operator=(__va_list_tag const&) |
34-
| file://:0:0:0:0 | operator= | function __va_list_tag& __va_list_tag::operator=(__va_list_tag&&) |
35-
| file://:0:0:0:0 | y | |

cpp/ql/test/library-tests/CPP-205/elements.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ string describe(Element e) {
1818

1919
from Element e
2020
where
21-
not e.getLocation() instanceof UnknownLocation and
21+
e.getLocation().getFile().getBaseName() != "" and
2222
not e instanceof Folder
2323
select e, concat(describe(e), ", ")

cpp/ql/test/library-tests/lambdas/captures/elements.expected

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| captures.cpp:0:0:0:0 | captures.cpp |
21
| captures.cpp:1:8:1:8 | declaration of operator= |
32
| captures.cpp:1:8:1:8 | declaration of operator= |
43
| captures.cpp:1:8:1:8 | operator= |
@@ -166,7 +165,6 @@
166165
| captures.cpp:26:10:26:17 | myLambda |
167166
| captures.cpp:26:18:26:18 | call to operator() |
168167
| captures.cpp:26:19:26:22 | 1000 |
169-
| end_pos.cpp:0:0:0:0 | end_pos.cpp |
170168
| end_pos.cpp:2:1:2:14 | #define OPEN { |
171169
| end_pos.cpp:3:6:3:10 | definition of igFun |
172170
| end_pos.cpp:3:6:3:10 | igFun |
@@ -211,108 +209,3 @@
211209
| end_pos.cpp:10:9:10:17 | return ... |
212210
| end_pos.cpp:10:16:10:16 | 1 |
213211
| end_pos.cpp:12:1:12:1 | return ... |
214-
| file://:0:0:0:0 | |
215-
| file://:0:0:0:0 | (global namespace) |
216-
| file://:0:0:0:0 | (reference to) |
217-
| file://:0:0:0:0 | (unnamed parameter 0) |
218-
| file://:0:0:0:0 | (unnamed parameter 0) |
219-
| file://:0:0:0:0 | (unnamed parameter 0) |
220-
| file://:0:0:0:0 | (unnamed parameter 0) |
221-
| file://:0:0:0:0 | (unnamed parameter 0) |
222-
| file://:0:0:0:0 | (unnamed parameter 0) |
223-
| file://:0:0:0:0 | (unnamed parameter 0) |
224-
| file://:0:0:0:0 | (unnamed parameter 0) |
225-
| file://:0:0:0:0 | (unnamed parameter 0) |
226-
| file://:0:0:0:0 | (unnamed parameter 0) |
227-
| file://:0:0:0:0 | (unnamed parameter 0) |
228-
| file://:0:0:0:0 | (unnamed parameter 0) |
229-
| file://:0:0:0:0 | (unnamed parameter 0) |
230-
| file://:0:0:0:0 | (unnamed parameter 0) |
231-
| file://:0:0:0:0 | (unnamed parameter 0) |
232-
| file://:0:0:0:0 | (unnamed parameter 0) |
233-
| file://:0:0:0:0 | (unnamed parameter 0) |
234-
| file://:0:0:0:0 | (unnamed parameter 0) |
235-
| file://:0:0:0:0 | (unnamed parameter 0) |
236-
| file://:0:0:0:0 | ..()(..) |
237-
| file://:0:0:0:0 | ..()(..) |
238-
| file://:0:0:0:0 | ..(*)(..) |
239-
| file://:0:0:0:0 | ..(*)(..) |
240-
| file://:0:0:0:0 | ..(*)(..) |
241-
| file://:0:0:0:0 | ..(..) |
242-
| file://:0:0:0:0 | __super |
243-
| file://:0:0:0:0 | __va_list_tag |
244-
| file://:0:0:0:0 | __va_list_tag & |
245-
| file://:0:0:0:0 | __va_list_tag && |
246-
| file://:0:0:0:0 | auto |
247-
| file://:0:0:0:0 | const __va_list_tag |
248-
| file://:0:0:0:0 | const __va_list_tag & |
249-
| file://:0:0:0:0 | const foo |
250-
| file://:0:0:0:0 | const foo & |
251-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 |
252-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 & |
253-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 * |
254-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 |
255-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 & |
256-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 * |
257-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 |
258-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 & |
259-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 * |
260-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 |
261-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 & |
262-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 * |
263-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 |
264-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 & |
265-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 * |
266-
| file://:0:0:0:0 | declaration of 1st parameter |
267-
| file://:0:0:0:0 | declaration of 1st parameter |
268-
| file://:0:0:0:0 | declaration of 1st parameter |
269-
| file://:0:0:0:0 | declaration of 1st parameter |
270-
| file://:0:0:0:0 | declaration of 1st parameter |
271-
| file://:0:0:0:0 | declaration of 1st parameter |
272-
| file://:0:0:0:0 | declaration of 1st parameter |
273-
| file://:0:0:0:0 | declaration of 1st parameter |
274-
| file://:0:0:0:0 | declaration of 1st parameter |
275-
| file://:0:0:0:0 | declaration of 1st parameter |
276-
| file://:0:0:0:0 | declaration of 1st parameter |
277-
| file://:0:0:0:0 | declaration of 1st parameter |
278-
| file://:0:0:0:0 | declaration of 1st parameter |
279-
| file://:0:0:0:0 | declaration of 1st parameter |
280-
| file://:0:0:0:0 | declaration of 1st parameter |
281-
| file://:0:0:0:0 | declaration of 1st parameter |
282-
| file://:0:0:0:0 | declaration of 1st parameter |
283-
| file://:0:0:0:0 | decltype([...](...){...}) |
284-
| file://:0:0:0:0 | decltype([...](...){...}) |
285-
| file://:0:0:0:0 | decltype([...](...){...}) |
286-
| file://:0:0:0:0 | decltype([...](...){...}) |
287-
| file://:0:0:0:0 | decltype([...](...){...}) |
288-
| file://:0:0:0:0 | definition of fp_offset |
289-
| file://:0:0:0:0 | definition of gp_offset |
290-
| file://:0:0:0:0 | definition of overflow_arg_area |
291-
| file://:0:0:0:0 | definition of reg_save_area |
292-
| file://:0:0:0:0 | foo & |
293-
| file://:0:0:0:0 | foo && |
294-
| file://:0:0:0:0 | foo * |
295-
| file://:0:0:0:0 | foo *const |
296-
| file://:0:0:0:0 | fp_offset |
297-
| file://:0:0:0:0 | gp_offset |
298-
| file://:0:0:0:0 | int & |
299-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 & |
300-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 && |
301-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 * |
302-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 & |
303-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 && |
304-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 * |
305-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 & |
306-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 && |
307-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 * |
308-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 & |
309-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 && |
310-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 * |
311-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 & |
312-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 && |
313-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 * |
314-
| file://:0:0:0:0 | operator= |
315-
| file://:0:0:0:0 | operator= |
316-
| file://:0:0:0:0 | overflow_arg_area |
317-
| file://:0:0:0:0 | reg_save_area |
318-
| file://:0:0:0:0 | void * |

cpp/ql/test/library-tests/lambdas/captures/elements.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import cpp
22

33
from Element e
44
where
5-
not e instanceof BuiltInType and
6-
not e instanceof Specifier and
7-
not e instanceof Folder
5+
e.getLocation().getFile().getBaseName() != "" and
6+
not e instanceof Container
87
select e

cpp/ql/test/library-tests/templates/extern/elements.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| extern.cpp:0:0:0:0 | extern.cpp |
21
| extern.cpp:1:20:1:20 | T |
32
| extern.cpp:1:20:1:20 | definition of T |
43
| extern.cpp:2:5:2:5 | declaration of f |

cpp/ql/test/library-tests/templates/extern/elements.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import cpp
22

33
from Element e
44
where
5-
exists(e.getLocation()) and
6-
not e.getLocation() instanceof UnknownLocation and
7-
not e instanceof Folder
5+
e.getLocation().getFile().getBaseName() != "" and
6+
not e instanceof Container
87
select e

0 commit comments

Comments
 (0)