Skip to content

Commit 98f4caf

Browse files
authored
Merge pull request #10645 from MathiasVP/add-more-range-analysis-tests
C++: Port SimpleRangeAnalysis tests to the new range-analysis
2 parents 8d1817b + cd65e73 commit 98f4caf

File tree

4 files changed

+1005
-2
lines changed

4 files changed

+1005
-2
lines changed

cpp/ql/test/library-tests/ir/range-analysis/RangeAnalysis.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class RangeAnalysisTest extends InlineExpectationsTest {
1717
tag = "range" and
1818
element = e.toString() and
1919
location = e.getLocation() and
20-
value = getARangeString(e)
20+
value = quote(getARangeString(e))
2121
)
2222
}
2323
}
@@ -33,6 +33,9 @@ private string getOffsetString(int value) {
3333
if value >= 0 then result = "+" + value.toString() else result = value.toString()
3434
}
3535

36+
bindingset[s]
37+
string quote(string s) { if s.matches("% %") then result = "\"" + s + "\"" else result = s }
38+
3639
bindingset[delta]
3740
private string getBoundString(SemBound b, int delta) {
3841
b instanceof SemZeroBound and result = delta.toString()

0 commit comments

Comments
 (0)