Skip to content

Commit

Permalink
Add test for multiple array types in single method
Browse files Browse the repository at this point in the history
  • Loading branch information
antlechner authored and smowton committed Jan 29, 2018
1 parent 5009cbb commit 1e11f6d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
Binary file not shown.
7 changes: 7 additions & 0 deletions regression/cbmc-java/lazyloading_multiple_array_types/A.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class A {

public int f() {
return 1;
}

}
Binary file not shown.
7 changes: 7 additions & 0 deletions regression/cbmc-java/lazyloading_multiple_array_types/B.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class B {

public int g() {
return 5;
}

}
Binary file not shown.
17 changes: 17 additions & 0 deletions regression/cbmc-java/lazyloading_multiple_array_types/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class Test {

A[] arrayA;
B[] arrayB;

public static void check(Test t) {
if (t == null || t.arrayA == null || t.arrayB == null ||
t.arrayA.length == 0 || t.arrayB.length == 0 ||
t.arrayA[0] == null || t.arrayB[0] == null)
return;
int i = t.arrayA[0].f();
int j = t.arrayB[0].g();
int sum = i + j;
assert(sum == 6);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Test.class
--lazy-methods --verbosity 10 --function Test.check
^EXIT=0$
^SIGNAL=0$
elaborate java::A\.f:\(\)I
elaborate java::B\.g:\(\)I
VERIFICATION SUCCESSFUL

0 comments on commit 1e11f6d

Please sign in to comment.