Skip to content

Commit edfccab

Browse files
Test for printing double values in trace
This checks a limit double value is printed with sufficient precision (the decimal version would not work so we have to use the hexidecimal).
1 parent ca20b14 commit edfccab

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
413 Bytes
Binary file not shown.

jbmc/regression/jbmc/double1/double1.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@ public static void main(String[] args)
1919
d=java.lang.Double.NEGATIVE_INFINITY;
2020
d=java.lang.Double.NaN;
2121
}
22+
23+
public static String testLimit(double inputValue) {
24+
if(0x1p-1022 == inputValue){
25+
assert(false);
26+
return "reach";
27+
}
28+
return "default";
29+
}
2230
}
2331

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
double1.class
3+
--function double1.testLimit --trace
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
INPUT arg0d: 0x1(\.0*)?p-1022 /\* 2.22507e-308
8+
--
9+
^warning: ignoring
10+
--
11+
Test double value are printed with sufficient precision

0 commit comments

Comments
 (0)