Skip to content

Commit 17d982d

Browse files
author
Matthias Güdemann
committed
Add regression tests for changes to JBMC enumeration support
1 parent 9145775 commit 17d982d

File tree

16 files changed

+70
-0
lines changed

16 files changed

+70
-0
lines changed
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.diffblue.regression;
2+
3+
public class Foo {
4+
public int foo(MyEnum e) {
5+
if (e == null) return 0;
6+
switch (e) {
7+
case A:
8+
return 1;
9+
case B:
10+
return 2;
11+
case C:
12+
return 3;
13+
}
14+
return 5;
15+
}
16+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.diffblue.regression;
2+
3+
enum MyEnum {
4+
A, B, C, D;
5+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
com/diffblue/regression/Foo.class
3+
--trace --cover location --depth 1024 --java-max-vla-length 16 --refine-strings --string-max-length 20 --string-printable --unwind 10 --function "com.diffblue.regression.Foo.foo" --java-unwind-enum-static
4+
line 8.*SATISFIED
5+
line 10.*SATISFIED
6+
line 12.*SATISFIED
7+
line 14.*SATISFIED
8+
^EXIT=0$
9+
^SIGNAL=0$
10+
--
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.diffblue.regression;
2+
public class EnumIter {
3+
int f() {
4+
MyEnum[] a = MyEnum.values();
5+
int num = a[2].ordinal() + a[3].ordinal();
6+
return num ;
7+
}
8+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.diffblue.regression;
2+
3+
enum MyEnum {
4+
A, B, C, D;
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
com/diffblue/regression/EnumIter.class
3+
--trace --cover location --depth 1024 --java-max-vla-length 16 --refine-strings --string-max-length 20 --string-printable --unwind 2 --function "com.diffblue.regression.EnumIter.f" --java-unwind-enum-static
4+
\d+ of \d+ covered \(100\.0%\)
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.diffblue.regression;
2+
public class EnumIter {
3+
String f() {
4+
MyEnum[] a = MyEnum.values();
5+
return a[2].name() + a[3].name();
6+
}
7+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.diffblue.regression;
2+
3+
enum MyEnum {
4+
A, B, C, D;
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
com/diffblue/regression/EnumIter.class
3+
--trace --cover location --depth 1024 --java-max-vla-length 16 --refine-strings --string-max-length 20 --string-printable --unwind 2 --function "com.diffblue.regression.EnumIter.f" --java-unwind-enum-static
4+
\d+ of \d+ covered \(100\.0%\)
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--

0 commit comments

Comments
 (0)