8318454: TestLayoutPaths broken on Big Endian platforms after JDK-8317837

Reviewed-by: mdoerr, mcimadamore
This commit is contained in:
Per Minborg 2023-10-19 10:47:53 +00:00
parent 3c70f2c1e9
commit defc7e0f8d

View File

@ -42,7 +42,6 @@ import java.util.function.IntFunction;
import static java.lang.foreign.MemoryLayout.PathElement.groupElement;
import static java.lang.foreign.MemoryLayout.PathElement.sequenceElement;
import static java.lang.foreign.ValueLayout.JAVA_INT;
import static java.lang.foreign.ValueLayout.JAVA_LONG;
import static java.lang.foreign.ValueLayout.JAVA_SHORT;
import static org.testng.Assert.*;
@ -139,8 +138,8 @@ public class TestLayoutPaths {
@Test
public void testBadAlignmentOfRoot() {
MemoryLayout struct = MemoryLayout.structLayout(
JAVA_INT,
JAVA_SHORT.withName("x"));
JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN),
JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN).withName("x"));
assertEquals(struct.byteAlignment(), 4);
try (Arena arena = Arena.ofConfined()) {