diff --git a/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs b/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs index 0092d9a11..05f5afbe3 100644 --- a/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs +++ b/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs @@ -1,5 +1,5 @@ using ARMeilleure.CodeGen.Arm64; -using NUnit.Framework; +using Xunit; namespace Ryujinx.Tests.Cpu { @@ -14,7 +14,7 @@ namespace Ryujinx.Tests.Cpu public int ImmR; } - public static readonly TestCase[] TestCases = + private static readonly TestCase[] _testCases = { new() { Value = 0, Valid = false, ImmN = 0, ImmS = 0, ImmR = 0 }, new() { Value = 0x970977f35f848714, Valid = false, ImmN = 0, ImmS = 0, ImmR = 0 }, @@ -32,15 +32,18 @@ namespace Ryujinx.Tests.Cpu new() { Value = 0x000000000ffff800, Valid = true, ImmN = 1, ImmS = 0x10, ImmR = 53 }, }; - [Test] - public void BitImmTests([ValueSource(nameof(TestCases))] TestCase test) + public static readonly EnumerableTheoryData TestData = new(_testCases); + + [Theory] + [MemberData(nameof(TestData))] + public void BitImmTests(TestCase test) { bool valid = CodeGenCommon.TryEncodeBitMask(test.Value, out int immN, out int immS, out int immR); - Assert.That(valid, Is.EqualTo(test.Valid)); - Assert.That(immN, Is.EqualTo(test.ImmN)); - Assert.That(immS, Is.EqualTo(test.ImmS)); - Assert.That(immR, Is.EqualTo(test.ImmR)); + Assert.Equal(test.Valid, valid); + Assert.Equal(test.ImmN, immN); + Assert.Equal(test.ImmS, immS); + Assert.Equal(test.ImmR, immR); } } } diff --git a/src/Ryujinx.Tests/Cpu/EnvironmentTests.cs b/src/Ryujinx.Tests/Cpu/EnvironmentTests.cs index 2a4775a31..b53503a7b 100644 --- a/src/Ryujinx.Tests/Cpu/EnvironmentTests.cs +++ b/src/Ryujinx.Tests/Cpu/EnvironmentTests.cs @@ -1,14 +1,14 @@ using ARMeilleure.Translation; -using NUnit.Framework; using Ryujinx.Cpu.Jit; using Ryujinx.Tests.Memory; using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; namespace Ryujinx.Tests.Cpu { - internal class EnvironmentTests + public class EnvironmentTests { #pragma warning disable IDE0052 // Remove unread private member private static Translator _translator; @@ -36,14 +36,14 @@ namespace Ryujinx.Tests.Cpu /// This test ensures that managed methods do not reset floating point control flags. /// This is used to avoid changing control flags when running methods that don't require it, such as SVC calls, software memory... /// - [Test] + [Fact] public void FpFlagsPInvoke() { EnsureTranslator(); // Subnormal results are not flushed to zero by default. // This operation should not be allowed to do constant propagation, hence the methods that explicitly disallow inlining. - Assert.AreNotEqual(GetDenormal() + GetZero(), 0f); + Assert.NotEqual(0f, GetDenormal() + GetZero()); bool methodCalled = false; bool isFz = false; @@ -56,7 +56,7 @@ namespace Ryujinx.Tests.Cpu int result = method(Marshal.GetFunctionPointerForDelegate(ManagedMethod)); // Subnormal results are not flushed to zero by default, which we should have returned to exiting the method. - Assert.AreNotEqual(GetDenormal() + GetZero(), 0f); + Assert.NotEqual(0f, GetDenormal() + GetZero()); Assert.True(result == 0); Assert.True(methodCalled);