C++: Rewrite local flow test to use TestSig

This commit is contained in:
Jeroen Ketema
2023-04-11 16:21:57 +02:00
parent b96bfea590
commit 9228e0deed
2 changed files with 11 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
failures
testFailures

View File

@@ -4,12 +4,10 @@ import cpp
import TestUtilities.InlineExpectationsTest
import semmle.code.cpp.security.FlowSources
class LocalFlowSourceTest extends InlineExpectationsTest {
LocalFlowSourceTest() { this = "LocalFlowSourceTest" }
module LocalFlowSourceTest implements TestSig {
string getARelevantTag() { result = "local_source" }
override string getARelevantTag() { result = "local_source" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "local_source" and
exists(LocalFlowSource node, int n |
n =
@@ -29,4 +27,10 @@ class LocalFlowSourceTest extends InlineExpectationsTest {
element = node.toString()
)
}
predicate hasOptionalResult(Location location, string element, string tag, string value) {
none()
}
}
import MakeTest<LocalFlowSourceTest>