Skip to content

Commit e1e2fe5

Browse files
committed
Fix indirect Enum test
This never actually checked for the right thing; the test happened to pass because the return value from Class.forName, when stubbed, might be null, and the actual code notionally under test was always unreachable. Since the test is only here to ensure we don't have an invariant violation when using an Enum which is never instantiated, I just remove the relevant condition from the test.
1 parent 719e9a9 commit e1e2fe5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
CORE
22
indirect/IndirectVirtualCall.class
33
--function indirect.IndirectVirtualCall.main
4-
function java::indirect\.TestEnum\.<clinit>:\(\)V$
54
^EXIT=10$
65
^SIGNAL=0$
76
--
87
^Invariant check failed$
8+
--
9+
In this test the Enum usage is actually unreachable, as our stubbed version
10+
of Class.forName always returns exactly a java.lang.Object, which cannot be
11+
cast to an Enum type. The test serves only to check we don't throw an invariant
12+
violation when casting to an uninstantiated Enum type.

0 commit comments

Comments
 (0)