Convert system CPU test to xUnit
This commit is contained in:
parent
f91273fd41
commit
2c884075ca
1 changed files with 23 additions and 14 deletions
|
@ -1,5 +1,8 @@
|
|||
// #define System
|
||||
#define System
|
||||
|
||||
using ARMeilleure.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
|
||||
namespace Ryujinx.Tests.Cpu
|
||||
|
@ -17,10 +20,10 @@ namespace Ryujinx.Tests.Cpu
|
|||
yield return 0x8000000000000000ul;
|
||||
yield return 0xFFFFFFFFFFFFFFFFul;
|
||||
|
||||
bool v = TestContext.CurrentContext.Random.NextBool();
|
||||
bool c = TestContext.CurrentContext.Random.NextBool();
|
||||
bool z = TestContext.CurrentContext.Random.NextBool();
|
||||
bool n = TestContext.CurrentContext.Random.NextBool();
|
||||
bool v = Random.Shared.NextBool();
|
||||
bool c = Random.Shared.NextBool();
|
||||
bool z = Random.Shared.NextBool();
|
||||
bool n = Random.Shared.NextBool();
|
||||
|
||||
ulong rnd = 0UL;
|
||||
|
||||
|
@ -44,19 +47,25 @@ namespace Ryujinx.Tests.Cpu
|
|||
}
|
||||
#endregion
|
||||
|
||||
[Test, Pairwise]
|
||||
public void MrsMsr_Nzcv([ValueSource(nameof(_MrsMsr_Nzcv_))] uint opcodes,
|
||||
[Values(0u, 1u, 31u)] uint rt,
|
||||
[ValueSource(nameof(_GenNzcv_))] ulong xt)
|
||||
private static readonly uint[] _testData_rt =
|
||||
{
|
||||
0u, 1u, 31u,
|
||||
};
|
||||
|
||||
public static readonly MatrixTheoryData<uint, uint, ulong> TestData = new(_MrsMsr_Nzcv_(), _testData_rt, _GenNzcv_());
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(TestData))]
|
||||
public void MrsMsr_Nzcv(uint opcodes, uint rt, ulong xt)
|
||||
{
|
||||
opcodes |= (rt & 31) << 0;
|
||||
|
||||
bool v = TestContext.CurrentContext.Random.NextBool();
|
||||
bool c = TestContext.CurrentContext.Random.NextBool();
|
||||
bool z = TestContext.CurrentContext.Random.NextBool();
|
||||
bool n = TestContext.CurrentContext.Random.NextBool();
|
||||
bool v = Random.Shared.NextBool();
|
||||
bool c = Random.Shared.NextBool();
|
||||
bool z = Random.Shared.NextBool();
|
||||
bool n = Random.Shared.NextBool();
|
||||
|
||||
ulong x31 = TestContext.CurrentContext.Random.NextULong();
|
||||
ulong x31 = Random.Shared.NextULong();
|
||||
|
||||
SingleOpcode(opcodes, x0: xt, x1: xt, x31: x31, overflow: v, carry: c, zero: z, negative: n);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue