Skip to content

Commit 9228e0d

Browse files
committed
C++: Rewrite local flow test to use TestSig
1 parent b96bfea commit 9228e0d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
failures
2+
testFailures

cpp/ql/test/library-tests/dataflow/source-sink-tests/local-flow.ql

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ import cpp
44
import TestUtilities.InlineExpectationsTest
55
import semmle.code.cpp.security.FlowSources
66

7-
class LocalFlowSourceTest extends InlineExpectationsTest {
8-
LocalFlowSourceTest() { this = "LocalFlowSourceTest" }
7+
module LocalFlowSourceTest implements TestSig {
8+
string getARelevantTag() { result = "local_source" }
99

10-
override string getARelevantTag() { result = "local_source" }
11-
12-
override predicate hasActualResult(Location location, string element, string tag, string value) {
10+
predicate hasActualResult(Location location, string element, string tag, string value) {
1311
tag = "local_source" and
1412
exists(LocalFlowSource node, int n |
1513
n =
@@ -29,4 +27,10 @@ class LocalFlowSourceTest extends InlineExpectationsTest {
2927
element = node.toString()
3028
)
3129
}
30+
31+
predicate hasOptionalResult(Location location, string element, string tag, string value) {
32+
none()
33+
}
3234
}
35+
36+
import MakeTest<LocalFlowSourceTest>

0 commit comments

Comments
 (0)