Skip to content

Commit df0605e

Browse files
committed
Add test for enum field of argument type
1 parent 49089b1 commit df0605e

File tree

7 files changed

+33
-0
lines changed

7 files changed

+33
-0
lines changed
800 Bytes
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public enum Color {
2+
RED,
3+
GREEN,
4+
BLUE
5+
}
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class MyClass {
2+
3+
private Color c;
4+
5+
public int myMethod() {
6+
if (c == null)
7+
return 10;
8+
return 20;
9+
}
10+
11+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class NondetEnumArgField {
2+
3+
public static void test(MyClass mc) {
4+
int result = mc.myMethod();
5+
assert result == 10;
6+
}
7+
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
NondetEnumArgField.class
3+
--function NondetEnumArgField.test --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
4+
^VERIFICATION FAILED$
5+
--
6+
--
7+
The test checks that even when none of the enum constants are referenced in user
8+
code, a nondet enum (in this case, a field of an argument) is still correctly
9+
loaded and initialized.

0 commit comments

Comments
 (0)