Skip to content

Commit aadf7ae

Browse files
committed
Go: Use new location in hasLocationInfo
1 parent 3f857e1 commit aadf7ae

File tree

37 files changed

+51
-51
lines changed

37 files changed

+51
-51
lines changed

go/ql/test/TestUtilities/InlineFlowTest.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class InlineFlowTest extends InlineExpectationsTest {
7979
override predicate hasActualResult(Location location, string element, string tag, string value) {
8080
tag = "hasValueFlow" and
8181
exists(DataFlow::Node src, DataFlow::Node sink | getValueFlowConfig().hasFlow(src, sink) |
82-
sink.hasLocationInfo(file, line, _, _, _) and
82+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
8383
element = sink.toString() and
8484
value = "\"" + sink.toString() + "\""
8585
)
@@ -88,7 +88,7 @@ class InlineFlowTest extends InlineExpectationsTest {
8888
exists(DataFlow::Node src, DataFlow::Node sink |
8989
getTaintFlowConfig().hasFlow(src, sink) and not getValueFlowConfig().hasFlow(src, sink)
9090
|
91-
sink.hasLocationInfo(file, line, _, _, _) and
91+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
9292
element = sink.toString() and
9393
value = "\"" + sink.toString() + "\""
9494
)

go/ql/test/experimental/frameworks/CleverGo/HeaderWrite.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
1212
override predicate hasActualResult(Location location, string element, string tag, string value) {
1313
// Dynamic key-value header:
1414
exists(HTTP::HeaderWrite hw |
15-
hw.hasLocationInfo(file, line, _, _, _) and
15+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1616
(
1717
element = hw.getName().toString() and
1818
value = hw.getName().toString() and
@@ -26,7 +26,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
2626
or
2727
// Static key, dynamic value header:
2828
exists(HTTP::HeaderWrite hw |
29-
hw.hasLocationInfo(file, line, _, _, _) and
29+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
3030
(
3131
element = hw.getHeaderName().toString() and
3232
value = hw.getHeaderName() and
@@ -40,7 +40,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
4040
or
4141
// Static key, static value header:
4242
exists(HTTP::HeaderWrite hw |
43-
hw.hasLocationInfo(file, line, _, _, _) and
43+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
4444
(
4545
element = hw.getHeaderName().toString() and
4646
value = hw.getHeaderName() and

go/ql/test/experimental/frameworks/CleverGo/HttpRedirect.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HttpRedirectTest extends InlineExpectationsTest {
1010
override predicate hasActualResult(Location location, string element, string tag, string value) {
1111
tag = "redirectUrl" and
1212
exists(HTTP::Redirect rd |
13-
rd.hasLocationInfo(file, line, _, _, _) and
13+
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1414
element = rd.getUrl().toString() and
1515
value = rd.getUrl().toString()
1616
)

go/ql/test/experimental/frameworks/CleverGo/HttpResponseBody.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class HttpResponseBodyTest extends InlineExpectationsTest {
99

1010
override predicate hasActualResult(Location location, string element, string tag, string value) {
1111
exists(HTTP::ResponseBody rd |
12-
rd.hasLocationInfo(file, line, _, _, _) and
12+
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1313
(
1414
element = rd.getAContentType().toString() and
1515
value = rd.getAContentType().toString() and

go/ql/test/experimental/frameworks/CleverGo/TaintTracking.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TaintTrackingTest extends InlineExpectationsTest {
2424
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
2525
element = sink.toString() and
2626
value = "" and
27-
sink.hasLocationInfo(file, line, _, _, _)
27+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn())
2828
)
2929
}
3030
}

go/ql/test/experimental/frameworks/CleverGo/UntrustedSources.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class UntrustedFlowSourceTest extends InlineExpectationsTest {
1616
|
1717
element = arg.toString() and
1818
value = "" and
19-
arg.hasLocationInfo(file, line, _, _, _)
19+
arg.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn())
2020
)
2121
}
2222
}

go/ql/test/experimental/frameworks/Fiber/HeaderWrite.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
1212
override predicate hasActualResult(Location location, string element, string tag, string value) {
1313
// Dynamic key-value header:
1414
exists(HTTP::HeaderWrite hw |
15-
hw.hasLocationInfo(file, line, _, _, _) and
15+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1616
(
1717
element = hw.getName().toString() and
1818
value = hw.getName().toString() and
@@ -26,7 +26,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
2626
or
2727
// Static key, dynamic value header:
2828
exists(HTTP::HeaderWrite hw |
29-
hw.hasLocationInfo(file, line, _, _, _) and
29+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
3030
(
3131
element = hw.getHeaderName().toString() and
3232
value = hw.getHeaderName() and
@@ -40,7 +40,7 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
4040
or
4141
// Static key, static value header:
4242
exists(HTTP::HeaderWrite hw |
43-
hw.hasLocationInfo(file, line, _, _, _) and
43+
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
4444
(
4545
element = hw.getHeaderName().toString() and
4646
value = hw.getHeaderName() and

go/ql/test/experimental/frameworks/Fiber/Redirect.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HttpRedirectTest extends InlineExpectationsTest {
1010
override predicate hasActualResult(Location location, string element, string tag, string value) {
1111
tag = "redirectUrl" and
1212
exists(HTTP::Redirect rd |
13-
rd.hasLocationInfo(file, line, _, _, _) and
13+
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1414
element = rd.getUrl().toString() and
1515
value = rd.getUrl().toString()
1616
)

go/ql/test/experimental/frameworks/Fiber/ResponseBody.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class HttpResponseBodyTest extends InlineExpectationsTest {
99

1010
override predicate hasActualResult(Location location, string element, string tag, string value) {
1111
exists(HTTP::ResponseBody rd |
12-
rd.hasLocationInfo(file, line, _, _, _) and
12+
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
1313
(
1414
element = rd.getAContentType().toString() and
1515
value = rd.getAContentType().toString() and

go/ql/test/experimental/frameworks/Fiber/TaintTracking.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TaintTrackingTest extends InlineExpectationsTest {
2424
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
2525
element = sink.toString() and
2626
value = "" and
27-
sink.hasLocationInfo(file, line, _, _, _)
27+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(), location.getStartColumn(), location.getEndLine(), location.getEndColumn())
2828
)
2929
}
3030
}

0 commit comments

Comments
 (0)