Skip to content

Commit bd8f557

Browse files
Lukasz A.J. Wronasmowton
Lukasz A.J. Wrona
authored andcommitted
Add nondet array primitive and reference tests
1 parent eb0f4cc commit bd8f557

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed
636 Bytes
Binary file not shown.

jbmc/regression/jbmc/lambda1/Nondet.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ public static void test(Nondet nondet) {
55
Function<Integer, Integer> lambda = (z) -> nondet.x + nondet.y + z;
66
assert(lambda.apply(0) == 42);
77
}
8+
public static void testPrimitiveArray(int[] ints) {
9+
Function<Integer, Integer> lambda = (index) -> ints[index];
10+
assert(lambda.apply(0) == 42);
11+
}
12+
public static void testReferenceArray(Nondet[] nondets) {
13+
Function<Integer, Integer> lambda = (index) -> nondets[index].x;
14+
assert(lambda.apply(0) == 42);
15+
}
816
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
Nondet.class
3+
--function Nondet.testPrimitiveArray --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
line 10 assertion.*FAILURE$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
--
8+
--
9+
Check that primitive arrays created by the object factory can be
10+
captured by a lambda
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
Nondet.class
3+
--function Nondet.testReferenceArray --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
line 14 assertion.*FAILURE$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
--
8+
--
9+
Check that reference arrays created by the object factory can be
10+
captured by a lambda

0 commit comments

Comments
 (0)