Skip to content

Commit 27d8f98

Browse files
committed
C++: Replace 'int' with 'float' in tests and accept test changes.
1 parent a2c0e36 commit 27d8f98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ private string getDirectionString(boolean d) {
2929
}
3030

3131
bindingset[value]
32-
private string getOffsetString(int value) {
32+
private string getOffsetString(float value) {
3333
if value >= 0 then result = "+" + value.toString() else result = value.toString()
3434
}
3535

3636
bindingset[s]
3737
string quote(string s) { if s.matches("% %") then result = "\"" + s + "\"" else result = s }
3838

3939
bindingset[delta]
40-
private string getBoundString(SemBound b, int delta) {
40+
private string getBoundString(SemBound b, float delta) {
4141
b instanceof SemZeroBound and result = delta.toString()
4242
or
4343
result =
@@ -51,7 +51,7 @@ private string getBoundString(SemBound b, int delta) {
5151
}
5252

5353
private string getARangeString(SemExpr e) {
54-
exists(SemBound b, int delta, boolean upper |
54+
exists(SemBound b, float delta, boolean upper |
5555
semBounded(e, b, delta, upper, _) and
5656
if semBounded(e, b, delta, upper.booleanNot(), _)
5757
then delta != 0 and result = "==" + getBoundString(b, delta)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ unsigned long mult_rounding() {
741741
range(y); // $ range===1000000003
742742
range(x); // $ range===1000000003
743743
xy = x * y;
744-
range(xy);
744+
range(xy); // $ range===1000000006000000000
745745
return xy; // BUG: upper bound should be >= 1000000006000000009UL
746746
}
747747

0 commit comments

Comments
 (0)