Skip to content

Commit 0bb11fa

Browse files
authored
fix PrintAST test run
The refactored shouldDumpFunction was now rejecting functions without a location. This is fixed now.
1 parent 0547e4c commit 0bb11fa

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
private import cpp
22

33
/**
4-
* Holds if an AST or IR with the specified location should be printed in the test output.
5-
*
6-
* This predicate excludes locations in standard headers.
4+
* Holds if the specified location is in standard headers.
75
*/
8-
predicate shouldDumpLocation(Location loc) {
9-
not loc.getFile().getAbsolutePath().regexpMatch(".*/include/[^/]+")
6+
predicate locationIsInStandardHeaders(Location loc) {
7+
loc.getFile().getAbsolutePath().regexpMatch(".*/include/[^/]+")
108
}
119

1210
/**
1311
* Holds if the AST or IR for the specified function should be printed in the test output.
1412
*
1513
* This predicate excludes functions defined in standard headers.
1614
*/
17-
predicate shouldDumpFunction(Function func) { shouldDumpLocation(func.getLocation()) }
15+
predicate shouldDumpFunction(Function func) { not locationIsInStandardHeaders(func.getLocation()) }

cpp/ql/test/library-tests/ir/ir/operand_locations.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ private import semmle.code.cpp.ir.IR
33
private import PrintConfig
44

55
from Operand a
6-
where shouldDumpLocation(a.getLocation())
6+
where not locationIsInStandardHeaders(a.getLocation())
77
select a, a.getDumpString()

0 commit comments

Comments
 (0)