diff --git a/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs b/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs index 05f5afbe3..a56f5848b 100644 --- a/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs +++ b/src/Ryujinx.Tests/Cpu/Arm64CodeGenCommonTests.cs @@ -1,17 +1,36 @@ using ARMeilleure.CodeGen.Arm64; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { public class Arm64CodeGenCommonTests { - public struct TestCase + public struct TestCase : IXunitSerializable { public ulong Value; public bool Valid; public int ImmN; public int ImmS; public int ImmR; + + public void Deserialize(IXunitSerializationInfo info) + { + Value = info.GetValue(nameof(Value)); + Valid = info.GetValue(nameof(Valid)); + ImmN = info.GetValue(nameof(ImmN)); + ImmS = info.GetValue(nameof(ImmS)); + ImmR = info.GetValue(nameof(ImmR)); + } + + public void Serialize(IXunitSerializationInfo info) + { + info.AddValue(nameof(Value), Value, Value.GetType()); + info.AddValue(nameof(Valid), Valid, Valid.GetType()); + info.AddValue(nameof(ImmN), ImmN, ImmN.GetType()); + info.AddValue(nameof(ImmS), ImmS, ImmS.GetType()); + info.AddValue(nameof(ImmR), ImmR, ImmR.GetType()); + } } private static readonly TestCase[] _testCases = diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs index e56531586..a1c0b6d84 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs @@ -3,6 +3,7 @@ using ARMeilleure.State; using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { @@ -10,7 +11,7 @@ namespace Ryujinx.Tests.Cpu public sealed class CpuTestAluBinary : CpuTest { #if AluBinary - public struct CrcTest + public struct CrcTest : IXunitSerializable { public uint Crc; public ulong Value; @@ -25,6 +26,22 @@ namespace Ryujinx.Tests.Cpu C = c; Results = results; } + + public void Deserialize(IXunitSerializationInfo info) + { + Crc = info.GetValue(nameof(Crc)); + Value = info.GetValue(nameof(Value)); + C = info.GetValue(nameof(C)); + Results = info.GetValue(nameof(Results)); + } + + public void Serialize(IXunitSerializationInfo info) + { + info.AddValue(nameof(Crc), Crc, Crc.GetType()); + info.AddValue(nameof(Value), Value, Value.GetType()); + info.AddValue(nameof(C), C, C.GetType()); + info.AddValue(nameof(Results), Results, Results.GetType()); + } } #region "ValueSource (CRC32)" diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs index 58aa48a74..1057e7ff7 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs @@ -3,6 +3,7 @@ using ARMeilleure.State; using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { @@ -11,7 +12,7 @@ namespace Ryujinx.Tests.Cpu public sealed class CpuTestAluBinary32 : CpuTest32 { #if AluBinary32 - public struct CrcTest32 + public struct CrcTest32 : IXunitSerializable { public uint Crc; public uint Value; @@ -26,6 +27,22 @@ namespace Ryujinx.Tests.Cpu C = c; Results = results; } + + public void Deserialize(IXunitSerializationInfo info) + { + Crc = info.GetValue(nameof(Crc)); + Value = info.GetValue(nameof(Value)); + C = info.GetValue(nameof(C)); + Results = info.GetValue(nameof(Results)); + } + + public void Serialize(IXunitSerializationInfo info) + { + info.AddValue(nameof(Crc), Crc, Crc.GetType()); + info.AddValue(nameof(Value), Value, Value.GetType()); + info.AddValue(nameof(C), C, C.GetType()); + info.AddValue(nameof(Results), Results, Results.GetType()); + } } #region "ValueSource (CRC32/CRC32C)" diff --git a/src/Ryujinx.Tests/Cpu/PrecomputedThumbTestCase.cs b/src/Ryujinx.Tests/Cpu/PrecomputedThumbTestCase.cs index 28d739fcd..051d90e75 100644 --- a/src/Ryujinx.Tests/Cpu/PrecomputedThumbTestCase.cs +++ b/src/Ryujinx.Tests/Cpu/PrecomputedThumbTestCase.cs @@ -1,9 +1,25 @@ +using Xunit.Abstractions; + namespace Ryujinx.Tests.Cpu { - public class PrecomputedThumbTestCase + public struct PrecomputedThumbTestCase : IXunitSerializable { public ushort[] Instructions; public uint[] StartRegs; public uint[] FinalRegs; + + public void Deserialize(IXunitSerializationInfo info) + { + Instructions = info.GetValue(nameof(Instructions)); + StartRegs = info.GetValue(nameof(StartRegs)); + FinalRegs = info.GetValue(nameof(FinalRegs)); + } + + public void Serialize(IXunitSerializationInfo info) + { + info.AddValue(nameof(Instructions), Instructions, Instructions.GetType()); + info.AddValue(nameof(StartRegs), StartRegs, StartRegs.GetType()); + info.AddValue(nameof(FinalRegs), FinalRegs, FinalRegs.GetType()); + } } }