diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs index f99357a223552..7889b117de7fd 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs @@ -55,7 +55,7 @@ struct BigArray_64_1 { } - [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 16 - 1)] + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 16 + 1)] struct BigArray_64_2 { } @@ -65,29 +65,39 @@ struct BigArray_32_1 { } - [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 8 - 1)] + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 8 + 1)] struct BigArray_32_2 { } - [Fact] - public static void TestLargeStructSize() + public static void Test64Bit () { - if (Environment.Is64BitProcess) - { Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_64_1)); Assert.Throws(() => sizeof(BigArray_64_2)); Assert.Throws(() => sizeof(X_64)); Assert.Throws(() => sizeof(X_explicit_64)); Assert.Throws(() => sizeof(Y_64)); - } - else - { + } + + public static void Test32Bit () + { Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_32_1)); Assert.Throws(() => sizeof(BigArray_32_2)); Assert.Throws(() => sizeof(X_32)); Assert.Throws(() => sizeof(X_explicit_32)); Assert.Throws(() => sizeof(Y_32)); + } + + [Fact] + public static void TestLargeStructSize() + { + if (Environment.Is64BitProcess) + { + Test64Bit (); + } + else + { + Test32Bit (); } } }