mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
C++/C#/Go: Use shared interpretModelForTest.
This commit is contained in:
@@ -101,9 +101,14 @@ private import internal.FlowSummaryImpl
|
||||
private import internal.FlowSummaryImpl::Public
|
||||
private import internal.FlowSummaryImpl::Private
|
||||
private import internal.FlowSummaryImpl::Private::External
|
||||
private import internal.ExternalFlowExtensions as Extensions
|
||||
private import internal.ExternalFlowExtensions
|
||||
private import codeql.mad.ModelValidation as SharedModelVal
|
||||
private import codeql.util.Unit
|
||||
private import codeql.mad.static.MaD as SharedMaD
|
||||
|
||||
private module MaD = SharedMaD::ModelsAsData<Extensions>;
|
||||
|
||||
import MaD
|
||||
|
||||
/**
|
||||
* A unit class for adding additional source model rows.
|
||||
@@ -230,49 +235,6 @@ private predicate summaryModel0(
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the given extension tuple `madId` should pretty-print as `model`.
|
||||
*
|
||||
* This predicate should only be used in tests.
|
||||
*/
|
||||
predicate interpretModelForTest(QlBuiltins::ExtensionId madId, string model) {
|
||||
exists(
|
||||
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||
string output, string kind, string provenance
|
||||
|
|
||||
Extensions::sourceModel(namespace, type, subtypes, name, signature, ext, output, kind,
|
||||
provenance, madId)
|
||||
|
|
||||
model =
|
||||
"Source: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; "
|
||||
+ ext + "; " + output + "; " + kind + "; " + provenance
|
||||
)
|
||||
or
|
||||
exists(
|
||||
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||
string input, string kind, string provenance
|
||||
|
|
||||
Extensions::sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance,
|
||||
madId)
|
||||
|
|
||||
model =
|
||||
"Sink: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; " +
|
||||
ext + "; " + input + "; " + kind + "; " + provenance
|
||||
)
|
||||
or
|
||||
exists(
|
||||
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||
string input, string output, string kind, string provenance
|
||||
|
|
||||
Extensions::summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind,
|
||||
provenance, madId)
|
||||
|
|
||||
model =
|
||||
"Summary: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature +
|
||||
"; " + ext + "; " + input + "; " + output + "; " + kind + "; " + provenance
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `input` is `input0`, but with all occurrences of `@` replaced
|
||||
* by `n` repetitions of `*` (and similarly for `output` and `output0`).
|
||||
|
||||
Reference in New Issue
Block a user