Skip to content

Commit 57192e8

Browse files
committed
Add even more tests
1 parent e813fa3 commit 57192e8

29 files changed

+646
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
testFailures
2+
invalidModelRow
3+
failures
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "PImplEmbedI1", True, "Source", "", "", "ReturnValue", "qltest", "manual"]
7+
- ["github.com/nonexistent/test", "PImplEmbedI1", True, "SourceField", "", "", "", "qltest", "manual"]
8+
- addsTo:
9+
pack: codeql/go-all
10+
extensible: summaryModel
11+
data:
12+
- ["github.com/nonexistent/test", "PImplEmbedI1", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
13+
- addsTo:
14+
pack: codeql/go-all
15+
extensible: sinkModel
16+
data:
17+
- ["github.com/nonexistent/test", "PImplEmbedI1", True, "Sink", "", "", "Argument[0]", "qltest", "manual"]
18+
- ["github.com/nonexistent/test", "PImplEmbedI1", True, "SinkField", "", "", "", "qltest", "manual"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import go
2+
import ModelValidation
3+
import TestUtilities.InlineExpectationsTest
4+
import MakeTest<FlowTest>
5+
6+
module Config implements DataFlow::ConfigSig {
7+
predicate isSource(DataFlow::Node source) { sourceNode(source, "qltest") }
8+
9+
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "qltest") }
10+
}
11+
12+
module Flow = TaintTracking::Global<Config>;
13+
14+
module FlowTest implements TestSig {
15+
string getARelevantTag() { result = "PImplEmbedI1[t]" }
16+
17+
predicate hasActualResult(Location location, string element, string tag, string value) {
18+
tag = "PImplEmbedI1[t]" and
19+
exists(DataFlow::Node sink | Flow::flowTo(sink) |
20+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
21+
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
22+
element = sink.toString() and
23+
value = ""
24+
)
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
testFailures
2+
invalidModelRow
3+
failures
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "PImplEmbedI2", True, "Source", "", "", "ReturnValue", "qltest", "manual"]
7+
- addsTo:
8+
pack: codeql/go-all
9+
extensible: summaryModel
10+
data:
11+
- ["github.com/nonexistent/test", "PImplEmbedI2", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
12+
- addsTo:
13+
pack: codeql/go-all
14+
extensible: sinkModel
15+
data:
16+
- ["github.com/nonexistent/test", "PImplEmbedI2", True, "Sink", "", "", "Argument[0]", "qltest", "manual"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import go
2+
import ModelValidation
3+
import TestUtilities.InlineExpectationsTest
4+
import MakeTest<FlowTest>
5+
6+
module Config implements DataFlow::ConfigSig {
7+
predicate isSource(DataFlow::Node source) { sourceNode(source, "qltest") }
8+
9+
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "qltest") }
10+
}
11+
12+
module Flow = TaintTracking::Global<Config>;
13+
14+
module FlowTest implements TestSig {
15+
string getARelevantTag() { result = "PImplEmbedI2[t]" }
16+
17+
predicate hasActualResult(Location location, string element, string tag, string value) {
18+
tag = "PImplEmbedI2[t]" and
19+
exists(DataFlow::Node sink | Flow::flowTo(sink) |
20+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
21+
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
22+
element = sink.toString() and
23+
value = ""
24+
)
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
testFailures
2+
invalidModelRow
3+
failures
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "SEmbedP1", True, "Source", "", "", "ReturnValue", "qltest", "manual"]
7+
- ["github.com/nonexistent/test", "SEmbedP1", True, "SourceField", "", "", "", "qltest", "manual"]
8+
- addsTo:
9+
pack: codeql/go-all
10+
extensible: summaryModel
11+
data:
12+
- ["github.com/nonexistent/test", "SEmbedP1", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
13+
- addsTo:
14+
pack: codeql/go-all
15+
extensible: sinkModel
16+
data:
17+
- ["github.com/nonexistent/test", "SEmbedP1", True, "Sink", "", "", "Argument[0]", "qltest", "manual"]
18+
- ["github.com/nonexistent/test", "SEmbedP1", True, "SinkField", "", "", "", "qltest", "manual"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import go
2+
import ModelValidation
3+
import TestUtilities.InlineExpectationsTest
4+
import MakeTest<FlowTest>
5+
6+
module Config implements DataFlow::ConfigSig {
7+
predicate isSource(DataFlow::Node source) { sourceNode(source, "qltest") }
8+
9+
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "qltest") }
10+
}
11+
12+
module Flow = TaintTracking::Global<Config>;
13+
14+
module FlowTest implements TestSig {
15+
string getARelevantTag() { result = "SEmbedP1[t]" }
16+
17+
predicate hasActualResult(Location location, string element, string tag, string value) {
18+
tag = "SEmbedP1[t]" and
19+
exists(DataFlow::Node sink | Flow::flowTo(sink) |
20+
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
21+
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
22+
element = sink.toString() and
23+
value = ""
24+
)
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
testFailures
2+
invalidModelRow
3+
failures

0 commit comments

Comments
 (0)