Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs')
-rw-r--r--src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs b/src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs
index 89a91c2175c..2bce0d91ae1 100644
--- a/src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs
+++ b/src/tests/JIT/HardwareIntrinsics/X86/X86Serialize/Serialize.cs
@@ -7,28 +7,23 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
-
+using Xunit;
namespace IntelHardwareIntrinsicTest
{
- class Program
+ public class Program
{
- const int Pass = 100;
- const int Fail = 0;
-
- static unsafe int Main(string[] args)
+ [Fact]
+ public static unsafe void Test()
{
- int testResult = X86Serialize.IsSupported ? Pass : Fail;
-
- try
+ if (X86Serialize.IsSupported)
{
+ // Should work without throwing
X86Serialize.Serialize();
}
- catch (Exception e)
+ else
{
- testResult = (X86Serialize.IsSupported || (e is not PlatformNotSupportedException)) ? Fail : Pass;
+ Assert.Throws<PlatformNotSupportedException>(X86Serialize.Serialize);
}
-
- return testResult;
}
}
}