Skip to content

Commit

Permalink
ignore pointer size tests
Browse files Browse the repository at this point in the history
As of JVM 12 and later it is no longer possible to cast away the
``final`` modifier using reflection so the ``forece{32,64}Bit``
helpers error out with an exception:

    Tests run: 34, Failures: 0, Errors: 2, Skipped: 1, Time elapsed: 0.052 sec <<< FAILURE! - in org.bridj.DemanglingTest
    testIntVsPointer_32bits(org.bridj.DemanglingTest)  Time elapsed: 0.006 sec  <<< ERROR!
    java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers
        at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
        at org.bridj.util.ReflectionUtils.makeFieldWritable(ReflectionUtils.java:42)
        at org.bridj.util.PlatformTestUtils.forcePointerSize(PlatformTestUtils.java:22)
        at org.bridj.util.PlatformTestUtils.force32Bits(PlatformTestUtils.java:30)
        at org.bridj.DemanglingTest.testIntVsPointer_32bits(DemanglingTest.java:553)

    testIntVsPointer_64bits(org.bridj.DemanglingTest)  Time elapsed: 0.001 sec  <<< ERROR!
    java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers
        at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
        at org.bridj.util.ReflectionUtils.makeFieldWritable(ReflectionUtils.java:42)
        at org.bridj.util.PlatformTestUtils.forcePointerSize(PlatformTestUtils.java:22)
        at org.bridj.util.PlatformTestUtils.force64Bits(PlatformTestUtils.java:33)
        at org.bridj.DemanglingTest.testIntVsPointer_64bits(DemanglingTest.java:566)

Disable those tests until the functionality can be restored.

References:

    - https://bugs.openjdk.java.net/browse/JDK-8210522
    - https://stackoverflow.com/a/56043252/7321177

Signed-off-by: Philipp Gesang <[email protected]>
  • Loading branch information
phi-gamma committed Feb 10, 2023
1 parent 5fd27c8 commit c1db53b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/java/org/bridj/DemanglingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ static void checkSymbol(String demanglerName, String str, MemberRef symbol, Type
}

@Test
@Ignore("Can’t work in JVM 12+: https://bugs.openjdk.org/browse/JDK-8210522")
public void testIntVsPointer_32bits() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
force32Bits();

Expand All @@ -562,6 +563,7 @@ public void testIntVsPointer_32bits() throws NoSuchFieldException, IllegalArgume
}

@Test
@Ignore("Can’t work in JVM 12+: https://bugs.openjdk.org/browse/JDK-8210522")
public void testIntVsPointer_64bits() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
force64Bits();

Expand Down

0 comments on commit c1db53b

Please sign in to comment.