Skip to content

Commit 8d20b9c

Browse files
committed
Use hasLocationInfo to match several Location fields at once
1 parent 3266f1f commit 8d20b9c

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

csharp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

go/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

java/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

python/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

ql/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

ruby/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

swift/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ abstract private class Expectation extends FailureLocatable {
331331
}
332332

333333
private predicate onSameLine(ValidExpectation a, ActualResult b) {
334-
exists(File f, int line, Location la, Location lb |
334+
exists(string fname, int line, Location la, Location lb |
335335
// Join order intent:
336336
// Take the locations of ActualResults,
337337
// join with locations in the same file / on the same line,
338338
// then match those against ValidExpectations.
339339
la = a.getLocation() and
340340
pragma[only_bind_into](lb) = b.getLocation() and
341-
locations_default(pragma[only_bind_into](la), f, line, _, _, _) and
342-
locations_default(lb, f, line, _, _, _)
341+
pragma[only_bind_into](la).hasLocationInfo(fname, line, _, _, _) and
342+
lb.hasLocationInfo(fname, line, _, _, _)
343343
)
344344
}
345345

0 commit comments

Comments
 (0)