mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Fix bug when RelatedLocation was used with a query ID
This commit is contained in:
@@ -11,4 +11,4 @@ testFailures
|
||||
| InlineTests.cs:37:28:37:38 | // ... | Missing result: Source |
|
||||
| InlineTests.cs:38:24:38:32 | // ... | Missing result: Sink |
|
||||
| InlineTests.cs:39:33:39:42 | // ... | Missing result: Alert |
|
||||
| InlineTests.cs:93:34:93:90 | // ... | Missing result: RelatedLocation[path-problem-query-with-related-loc] |
|
||||
| InlineTests.cs:99:19:99:27 | "Related" | Unexpected result: RelatedLocation |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#select
|
||||
| InlineTests.cs:22:13:22:21 | "Alert:1" | This is a problem with $@ | InlineTests.cs:21:23:21:31 | "Related" | a related location |
|
||||
| InlineTests.cs:26:13:26:21 | "Alert:1" | This is a problem with $@ | InlineTests.cs:25:19:25:27 | "Related" | a related location |
|
||||
testFailures
|
||||
| InlineTests.cs:6:26:6:35 | // ... | Missing result: Alert |
|
||||
| InlineTests.cs:12:34:12:43 | // ... | Missing result: Alert |
|
||||
| InlineTests.cs:25:19:25:27 | "Related" | Unexpected result: RelatedLocation |
|
||||
| InlineTests.cs:34:30:34:39 | // ... | Missing result: Alert |
|
||||
| InlineTests.cs:39:33:39:42 | // ... | Missing result: Alert |
|
||||
@@ -892,12 +892,19 @@ module TestPostProcessing {
|
||||
not hasPathProblemSink(row, location, _, _)
|
||||
}
|
||||
|
||||
private predicate shouldReportRelatedLocations() {
|
||||
exists(string tag |
|
||||
hasExpectationWithValue(tag, _) and
|
||||
PathProblemSourceTestInput::tagMatches(tag, "RelatedLocation")
|
||||
)
|
||||
}
|
||||
|
||||
private predicate hasRelatedLocation(
|
||||
int row, TestLocation location, string element, string tag
|
||||
) {
|
||||
getQueryKind() = ["problem", "path-problem"] and
|
||||
location = getRelatedLocation(row, _, element) and
|
||||
hasExpectationWithValue("RelatedLocation", _) and
|
||||
shouldReportRelatedLocations() and
|
||||
tag = "RelatedLocation" and
|
||||
not hasAlert(row, location, _, _) and
|
||||
not hasPathProblemSource(row, location, _, _, _) and
|
||||
|
||||
Reference in New Issue
Block a user