mirror of
https://github.com/github/codeql.git
synced 2026-05-28 10:01:25 +02:00
23 lines
673 B
Plaintext
23 lines
673 B
Plaintext
import cpp
|
|
import utils.test.InlineExpectationsTest
|
|
import semmle.code.cpp.dataflow.new.DataFlow::DataFlow
|
|
|
|
bindingset[s]
|
|
string quote(string s) { if s.matches("% %") then result = "\"" + s + "\"" else result = s }
|
|
|
|
module AsDefinitionTest implements TestSig {
|
|
string getARelevantTag() { result = ["certain", "uncertain"] }
|
|
|
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
exists(Ssa::Definition d |
|
|
location = d.getLocation() and
|
|
element = d.toString() and
|
|
value = quote(d.toString())
|
|
|
|
|
if d.isCertain() then tag = "certain" else tag = "uncertain"
|
|
)
|
|
}
|
|
}
|
|
|
|
import MakeTest<AsDefinitionTest>
|