diff --git a/src/Ryujinx.Tests/Audio/Renderer/AudioRendererConfigurationTests.cs b/src/Ryujinx.Tests/Audio/Renderer/AudioRendererConfigurationTests.cs index 845b6493c..463f6a0bc 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/AudioRendererConfigurationTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/AudioRendererConfigurationTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class AudioRendererConfigurationTests + public class AudioRendererConfigurationTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x34, Unsafe.SizeOf()); + Assert.Equal(0x34, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/BehaviourParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/BehaviourParameterTests.cs index 1d8c8964f..ffdb977c8 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/BehaviourParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/BehaviourParameterTests.cs @@ -1,16 +1,16 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Common; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class BehaviourParameterTests + public class BehaviourParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/BiquadFilterParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/BiquadFilterParameterTests.cs index 617b52457..3919c3f63 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/BiquadFilterParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/BiquadFilterParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class BiquadFilterParameterTests + public class BiquadFilterParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0xC, Unsafe.SizeOf()); + Assert.Equal(0xC, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Common/UpdateDataHeaderTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Common/UpdateDataHeaderTests.cs index 256679f73..6a0610e40 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Common/UpdateDataHeaderTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Common/UpdateDataHeaderTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Common; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Common { - class UpdateDataHeaderTests + public class UpdateDataHeaderTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x40, Unsafe.SizeOf()); + Assert.Equal(0x40, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Common/VoiceUpdateStateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Common/VoiceUpdateStateTests.cs index 7b09d18cc..5148420e8 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Common/VoiceUpdateStateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Common/VoiceUpdateStateTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Common; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Common { - class VoiceUpdateStateTests + public class VoiceUpdateStateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.LessOrEqual(Unsafe.SizeOf(), 0x100); + Assert.True(Unsafe.SizeOf() <= 0x100); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Common/WaveBufferTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Common/WaveBufferTests.cs index 91f9c0561..ed898fb1d 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Common/WaveBufferTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Common/WaveBufferTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Common; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Common { - class WaveBufferTests + public class WaveBufferTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x30, Unsafe.SizeOf()); + Assert.Equal(0x30, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Dsp/ResamplerTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Dsp/ResamplerTests.cs index f393c971a..4a5d2c25c 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Dsp/ResamplerTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Dsp/ResamplerTests.cs @@ -1,25 +1,25 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Dsp; using Ryujinx.Audio.Renderer.Parameter; using System; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Dsp { - class ResamplerTests + public class ResamplerTests { - [Test] - [TestCase(VoiceInParameter.SampleRateConversionQuality.Low)] - [TestCase(VoiceInParameter.SampleRateConversionQuality.Default)] - [TestCase(VoiceInParameter.SampleRateConversionQuality.High)] + [Theory] + [InlineData(VoiceInParameter.SampleRateConversionQuality.Low)] + [InlineData(VoiceInParameter.SampleRateConversionQuality.Default)] + [InlineData(VoiceInParameter.SampleRateConversionQuality.High)] public void TestResamplerConsistencyUpsampling(VoiceInParameter.SampleRateConversionQuality quality) { DoResamplingTest(44100, 48000, quality); } - [Test] - [TestCase(VoiceInParameter.SampleRateConversionQuality.Low)] - [TestCase(VoiceInParameter.SampleRateConversionQuality.Default)] - [TestCase(VoiceInParameter.SampleRateConversionQuality.High)] + [Theory] + [InlineData(VoiceInParameter.SampleRateConversionQuality.Low)] + [InlineData(VoiceInParameter.SampleRateConversionQuality.Default)] + [InlineData(VoiceInParameter.SampleRateConversionQuality.High)] public void TestResamplerConsistencyDownsampling(VoiceInParameter.SampleRateConversionQuality quality) { DoResamplingTest(48000, 44100, quality); @@ -74,13 +74,13 @@ namespace Ryujinx.Tests.Audio.Renderer.Dsp float thisDelta = Math.Abs(expectedOutput[sample] - outputBuffer[sample]); // Ensure no discontinuities - Assert.IsTrue(thisDelta < 0.1f); + Assert.True(thisDelta < 0.1f); sumDifference += thisDelta; } sumDifference /= outputSampleCount; // Expect the output to be 99% similar to the expected resampled sine wave - Assert.IsTrue(sumDifference < 0.01f); + Assert.True(sumDifference < 0.01f); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Dsp/UpsamplerTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Dsp/UpsamplerTests.cs index 3b1b94441..ab31665e7 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Dsp/UpsamplerTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Dsp/UpsamplerTests.cs @@ -1,13 +1,13 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Dsp; using Ryujinx.Audio.Renderer.Server.Upsampler; using System; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Dsp { - class UpsamplerTests + public class UpsamplerTests { - [Test] + [Fact] public void TestUpsamplerConsistency() { UpsamplerBufferState bufferState = new(); @@ -51,7 +51,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Dsp sumDifference /= expectedOutput.Length; // Expect the output to be 98% similar to the expected resampled sine wave - Assert.IsTrue(sumDifference < 0.02f); + Assert.True(sumDifference < 0.02f); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/EffectInfoParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/EffectInfoParameterTests.cs index ee28423be..16e0eda0c 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/EffectInfoParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/EffectInfoParameterTests.cs @@ -1,16 +1,16 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class EffectInfoParameterTests + public class EffectInfoParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0xC0, Unsafe.SizeOf()); - Assert.AreEqual(0xC0, Unsafe.SizeOf()); + Assert.Equal(0xC0, Unsafe.SizeOf()); + Assert.Equal(0xC0, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/EffectOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/EffectOutStatusTests.cs index 2a4449437..8575931a7 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/EffectOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/EffectOutStatusTests.cs @@ -1,16 +1,16 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class EffectOutStatusTests + public class EffectOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); - Assert.AreEqual(0x90, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); + Assert.Equal(0x90, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/MemoryPoolParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/MemoryPoolParameterTests.cs index 733629a95..abad942b2 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/MemoryPoolParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/MemoryPoolParameterTests.cs @@ -1,16 +1,16 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class MemoryPoolParameterTests + public class MemoryPoolParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/BehaviourErrorInfoOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/BehaviourErrorInfoOutStatusTests.cs index a21729561..f77edf463 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/BehaviourErrorInfoOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/BehaviourErrorInfoOutStatusTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class BehaviourErrorInfoOutStatusTests + public class BehaviourErrorInfoOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0xB0, Unsafe.SizeOf()); + Assert.Equal(0xB0, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/AuxParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/AuxParameterTests.cs index 75b24c40a..aa06c6d71 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/AuxParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/AuxParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class AuxParameterTests + public class AuxParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x6C, Unsafe.SizeOf()); + Assert.Equal(0x6C, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BiquadFilterEffectParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BiquadFilterEffectParameterTests.cs index 73c1ea9d3..b216e87f0 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BiquadFilterEffectParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BiquadFilterEffectParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class BiquadFilterEffectParameterTests + public class BiquadFilterEffectParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x18, Unsafe.SizeOf()); + Assert.Equal(0x18, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BufferMixerParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BufferMixerParameterTests.cs index 7a86e3736..fdb954a8d 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BufferMixerParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/BufferMixerParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class BufferMixerParameterTests + public class BufferMixerParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x94, Unsafe.SizeOf()); + Assert.Equal(0x94, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/CompressorParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/CompressorParameterTests.cs index de7733ae4..297f75bc6 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/CompressorParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/CompressorParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class CompressorParameterTests + public class CompressorParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x38, Unsafe.SizeOf()); + Assert.Equal(0x38, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/DelayParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/DelayParameterTests.cs index 3daaf9a16..41fbb39e6 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/DelayParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/DelayParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class DelayParameterTests + public class DelayParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x35, Unsafe.SizeOf()); + Assert.Equal(0x35, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterParameterTests.cs index b74999567..439ed9f03 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class LimiterParameterTests + public class LimiterParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x44, Unsafe.SizeOf()); + Assert.Equal(0x44, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterStatisticsTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterStatisticsTests.cs index 9b3bfb13f..0bc4cbcf7 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterStatisticsTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/LimiterStatisticsTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class LimiterStatisticsTests + public class LimiterStatisticsTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x30, Unsafe.SizeOf()); + Assert.Equal(0x30, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/Reverb3dParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/Reverb3dParameterTests.cs index a5d562fbe..e024bc862 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/Reverb3dParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/Reverb3dParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class Reverb3dParameterTests + public class Reverb3dParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x49, Unsafe.SizeOf()); + Assert.Equal(0x49, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/ReverbParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/ReverbParameterTests.cs index 6cc103f82..b3d0294f2 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/ReverbParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Effect/ReverbParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Effect; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect { - class ReverbParameterTests + public class ReverbParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x41, Unsafe.SizeOf()); + Assert.Equal(0x41, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixInParameterDirtyOnlyUpdateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixInParameterDirtyOnlyUpdateTests.cs index 148e8a5db..186881b23 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixInParameterDirtyOnlyUpdateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixInParameterDirtyOnlyUpdateTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class MixInParameterDirtyOnlyUpdateTests + public class MixInParameterDirtyOnlyUpdateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixParameterTests.cs index d9c0e1c73..384cefa0b 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/MixParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class MixParameterTests + public class MixParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x930, Unsafe.SizeOf()); + Assert.Equal(0x930, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceInParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceInParameterTests.cs index 685b9ed5f..e5db3026f 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceInParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceInParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Performance; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class PerformanceInParameterTests + public class PerformanceInParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceOutStatusTests.cs index eb39fe48d..229a22299 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/PerformanceOutStatusTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Performance; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class PerformanceOutStatusTests + public class PerformanceOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/RendererInfoOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/RendererInfoOutStatusTests.cs index 34f049656..3aa26500e 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/RendererInfoOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/RendererInfoOutStatusTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class RendererInfoOutStatusTests + public class RendererInfoOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/CircularBufferParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/CircularBufferParameterTests.cs index f5113fd06..68e9ca869 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/CircularBufferParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/CircularBufferParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Sink; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink { - class CircularBufferParameterTests + public class CircularBufferParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x24, Unsafe.SizeOf()); + Assert.Equal(0x24, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/DeviceParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/DeviceParameterTests.cs index e7677c822..59c48255f 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/DeviceParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/Sink/DeviceParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter.Sink; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink { - class DeviceParameterTests + public class DeviceParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x11C, Unsafe.SizeOf()); + Assert.Equal(0x11C, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkInParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkInParameterTests.cs index 84f9cd9a1..46e366523 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkInParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkInParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class SinkInParameterTests + public class SinkInParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x140, Unsafe.SizeOf()); + Assert.Equal(0x140, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkOutStatusTests.cs index 18c501d22..3a1172ba1 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SinkOutStatusTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class SinkOutStatusTests + public class SinkOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SplitterInParamHeaderTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SplitterInParamHeaderTests.cs index f7a2965f5..b566bb0c9 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Parameter/SplitterInParamHeaderTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Parameter/SplitterInParamHeaderTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Parameter { - class SplitterInParamHeaderTests + public class SplitterInParamHeaderTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs index 53a662584..ddd9d3d4f 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs @@ -1,19 +1,19 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.MemoryPool; using System; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class AddressInfoTests + public class AddressInfoTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); } - [Test] + [Fact] public void TestGetReference() { MemoryPoolState[] memoryPoolState = new MemoryPoolState[1]; @@ -25,11 +25,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server addressInfo.ForceMappedDspAddress = 0x2000000; - Assert.AreEqual(0x2000000, addressInfo.GetReference(true)); + Assert.Equal(0x2000000ul, addressInfo.GetReference(true)); addressInfo.SetupMemoryPool(memoryPoolState.AsSpan()); - Assert.AreEqual(0x4000000, addressInfo.GetReference(true)); + Assert.Equal(0x4000000ul, addressInfo.GetReference(true)); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/BehaviourContextTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/BehaviourContextTests.cs index 557581881..007414d91 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/BehaviourContextTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/BehaviourContextTests.cs @@ -1,296 +1,296 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { public class BehaviourContextTests { - [Test] + [Fact] public void TestCheckFeature() { int latestRevision = BehaviourContext.BaseRevisionMagic + BehaviourContext.LastRevision; int previousRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision - 1); int invalidRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision + 1); - Assert.IsTrue(BehaviourContext.CheckFeatureSupported(latestRevision, latestRevision)); - Assert.IsFalse(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision)); - Assert.IsTrue(BehaviourContext.CheckFeatureSupported(latestRevision, previousRevision)); + Assert.True(BehaviourContext.CheckFeatureSupported(latestRevision, latestRevision)); + Assert.False(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision)); + Assert.True(BehaviourContext.CheckFeatureSupported(latestRevision, previousRevision)); // In case we get an invalid revision, this is supposed to auto default to REV1 internally.. idk what the hell Nintendo was thinking here.. - Assert.IsTrue(BehaviourContext.CheckFeatureSupported(invalidRevision, latestRevision)); + Assert.True(BehaviourContext.CheckFeatureSupported(invalidRevision, latestRevision)); } - [Test] + [Fact] public void TestsMemoryPoolForceMappingEnabled() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); - Assert.IsFalse(behaviourContext.IsMemoryPoolForceMappingEnabled()); + Assert.False(behaviourContext.IsMemoryPoolForceMappingEnabled()); behaviourContext.UpdateFlags(0x1); - Assert.IsTrue(behaviourContext.IsMemoryPoolForceMappingEnabled()); + Assert.True(behaviourContext.IsMemoryPoolForceMappingEnabled()); } - [Test] + [Fact] public void TestRevision1() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); - Assert.IsFalse(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsFalse(behaviourContext.IsSplitterSupported()); - Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); - Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.False(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.False(behaviourContext.IsSplitterSupported()); + Assert.False(behaviourContext.IsLongSizePreDelaySupported()); + Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.False(behaviourContext.IsSplitterBugFixed()); + Assert.False(behaviourContext.IsElapsedFrameCountSupported()); + Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision2() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision2); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); - Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.False(behaviourContext.IsLongSizePreDelaySupported()); + Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.False(behaviourContext.IsSplitterBugFixed()); + Assert.False(behaviourContext.IsElapsedFrameCountSupported()); + Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision3() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision3); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); - Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.False(behaviourContext.IsSplitterBugFixed()); + Assert.False(behaviourContext.IsElapsedFrameCountSupported()); + Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision4() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); - Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.False(behaviourContext.IsSplitterBugFixed()); + Assert.False(behaviourContext.IsElapsedFrameCountSupported()); + Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision5() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision5); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision6() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision6); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision7() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision7); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.False(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision8() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision8); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.True(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.False(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision9() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision9); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.True(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.True(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } - [Test] + [Fact] public void TestRevision10() { BehaviourContext behaviourContext = new(); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision10); - Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); - Assert.IsTrue(behaviourContext.IsSplitterSupported()); - Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); - Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); - Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); - Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); - Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); - Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); - Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); - Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); - Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); - Assert.IsTrue(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); + Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed()); + Assert.True(behaviourContext.IsSplitterSupported()); + Assert.True(behaviourContext.IsLongSizePreDelaySupported()); + Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported()); + Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported()); + Assert.True(behaviourContext.IsSplitterBugFixed()); + Assert.True(behaviourContext.IsElapsedFrameCountSupported()); + Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported()); + Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); + Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); + Assert.True(behaviourContext.IsWaveBufferVersion2Supported()); + Assert.True(behaviourContext.IsEffectInfoVersion2Supported()); + Assert.True(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); - Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); - Assert.AreEqual(4, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); - Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); + Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); + Assert.Equal(4, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); + Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/MemoryPoolStateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/MemoryPoolStateTests.cs index c6a2e473e..9af280346 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/MemoryPoolStateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/MemoryPoolStateTests.cs @@ -1,18 +1,18 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.MemoryPool; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class MemoryPoolStateTests + public class MemoryPoolStateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(Unsafe.SizeOf(), 0x20); + Assert.Equal(0x20, Unsafe.SizeOf()); } - [Test] + [Fact] public void TestContains() { MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); @@ -21,15 +21,15 @@ namespace Ryujinx.Tests.Audio.Renderer.Server memoryPool.DspAddress = 0x2000000; - Assert.IsTrue(memoryPool.Contains(0x1000000, 0x10)); - Assert.IsTrue(memoryPool.Contains(0x1000FE0, 0x10)); - Assert.IsTrue(memoryPool.Contains(0x1000FFF, 0x1)); - Assert.IsFalse(memoryPool.Contains(0x1000FFF, 0x2)); - Assert.IsFalse(memoryPool.Contains(0x1001000, 0x10)); - Assert.IsFalse(memoryPool.Contains(0x2000000, 0x10)); + Assert.True(memoryPool.Contains(0x1000000, 0x10)); + Assert.True(memoryPool.Contains(0x1000FE0, 0x10)); + Assert.True(memoryPool.Contains(0x1000FFF, 0x1)); + Assert.False(memoryPool.Contains(0x1000FFF, 0x2)); + Assert.False(memoryPool.Contains(0x1001000, 0x10)); + Assert.False(memoryPool.Contains(0x2000000, 0x10)); } - [Test] + [Fact] public void TestTranslate() { MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); @@ -38,25 +38,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server memoryPool.DspAddress = 0x2000000; - Assert.AreEqual(0x2000FE0, memoryPool.Translate(0x1000FE0, 0x10)); - Assert.AreEqual(0x2000FFF, memoryPool.Translate(0x1000FFF, 0x1)); - Assert.AreEqual(0x0, memoryPool.Translate(0x1000FFF, 0x2)); - Assert.AreEqual(0x0, memoryPool.Translate(0x1001000, 0x10)); - Assert.AreEqual(0x0, memoryPool.Translate(0x2000000, 0x10)); + Assert.Equal(0x2000FE0ul, memoryPool.Translate(0x1000FE0, 0x10)); + Assert.Equal(0x2000FFFul, memoryPool.Translate(0x1000FFF, 0x1)); + Assert.Equal(0x0ul, memoryPool.Translate(0x1000FFF, 0x2)); + Assert.Equal(0x0ul, memoryPool.Translate(0x1001000, 0x10)); + Assert.Equal(0x0ul, memoryPool.Translate(0x2000000, 0x10)); } - [Test] + [Fact] public void TestIsMapped() { MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); memoryPool.SetCpuAddress(0x1000000, 0x1000); - Assert.IsFalse(memoryPool.IsMapped()); + Assert.False(memoryPool.IsMapped()); memoryPool.DspAddress = 0x2000000; - Assert.IsTrue(memoryPool.IsMapped()); + Assert.True(memoryPool.IsMapped()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/MixStateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/MixStateTests.cs index 6262913b4..b9a21aa16 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/MixStateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/MixStateTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Mix; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class MixStateTests + public class MixStateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x940, Unsafe.SizeOf()); + Assert.Equal(0x940, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/PoolMapperTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/PoolMapperTests.cs index d7879d627..34585f5fb 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/PoolMapperTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/PoolMapperTests.cs @@ -1,18 +1,18 @@ -using NUnit.Framework; using Ryujinx.Audio; using Ryujinx.Audio.Renderer.Server.MemoryPool; using System; +using Xunit; using static Ryujinx.Audio.Renderer.Common.BehaviourParameter; using CpuAddress = System.UInt64; using DspAddress = System.UInt64; namespace Ryujinx.Tests.Audio.Renderer.Server { - class PoolMapperTests + public class PoolMapperTests { private const uint DummyProcessHandle = 0xCAFEBABE; - [Test] + [Fact] public void TestInitializeSystemPool() { PoolMapper poolMapper = new(DummyProcessHandle, true); @@ -23,26 +23,26 @@ namespace Ryujinx.Tests.Audio.Renderer.Server const DspAddress DspAddress = CpuAddress; // TODO: DSP LLE const ulong CpuSize = 0x1000; - Assert.IsFalse(poolMapper.InitializeSystemPool(ref memoryPoolCpu, CpuAddress, CpuSize)); - Assert.IsTrue(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize)); + Assert.False(poolMapper.InitializeSystemPool(ref memoryPoolCpu, CpuAddress, CpuSize)); + Assert.True(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize)); - Assert.AreEqual(CpuAddress, memoryPoolDsp.CpuAddress); - Assert.AreEqual(CpuSize, memoryPoolDsp.Size); - Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); + Assert.Equal(CpuAddress, memoryPoolDsp.CpuAddress); + Assert.Equal(CpuSize, memoryPoolDsp.Size); + Assert.Equal(DspAddress, memoryPoolDsp.DspAddress); } - [Test] + [Fact] public void TestGetProcessHandle() { PoolMapper poolMapper = new(DummyProcessHandle, true); MemoryPoolState memoryPoolDsp = MemoryPoolState.Create(MemoryPoolState.LocationType.Dsp); MemoryPoolState memoryPoolCpu = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); - Assert.AreEqual(0xFFFF8001, poolMapper.GetProcessHandle(ref memoryPoolCpu)); - Assert.AreEqual(DummyProcessHandle, poolMapper.GetProcessHandle(ref memoryPoolDsp)); + Assert.Equal(0xFFFF8001, poolMapper.GetProcessHandle(ref memoryPoolCpu)); + Assert.Equal(DummyProcessHandle, poolMapper.GetProcessHandle(ref memoryPoolDsp)); } - [Test] + [Fact] public void TestMappings() { PoolMapper poolMapper = new(DummyProcessHandle, true); @@ -56,18 +56,18 @@ namespace Ryujinx.Tests.Audio.Renderer.Server memoryPoolDsp.SetCpuAddress(CpuAddress, CpuSize); memoryPoolCpu.SetCpuAddress(CpuAddress, CpuSize); - Assert.AreEqual(DspAddress, poolMapper.Map(ref memoryPoolCpu)); - Assert.AreEqual(DspAddress, poolMapper.Map(ref memoryPoolDsp)); - Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); - Assert.IsTrue(poolMapper.Unmap(ref memoryPoolCpu)); + Assert.Equal(DspAddress, poolMapper.Map(ref memoryPoolCpu)); + Assert.Equal(DspAddress, poolMapper.Map(ref memoryPoolDsp)); + Assert.Equal(DspAddress, memoryPoolDsp.DspAddress); + Assert.True(poolMapper.Unmap(ref memoryPoolCpu)); memoryPoolDsp.IsUsed = true; - Assert.IsFalse(poolMapper.Unmap(ref memoryPoolDsp)); + Assert.False(poolMapper.Unmap(ref memoryPoolDsp)); memoryPoolDsp.IsUsed = false; - Assert.IsTrue(poolMapper.Unmap(ref memoryPoolDsp)); + Assert.True(poolMapper.Unmap(ref memoryPoolDsp)); } - [Test] + [Fact] public void TestTryAttachBuffer() { const CpuAddress CpuAddress = 0x20000; @@ -90,45 +90,45 @@ namespace Ryujinx.Tests.Audio.Renderer.Server PoolMapper poolMapper = new(DummyProcessHandle, true); - Assert.IsTrue(poolMapper.TryAttachBuffer(out ErrorInfo errorInfo, ref addressInfo, 0, 0)); + Assert.True(poolMapper.TryAttachBuffer(out ErrorInfo errorInfo, ref addressInfo, 0, 0)); - Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); - Assert.AreEqual(0, errorInfo.ExtraErrorInfo); - Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); + Assert.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); + Assert.Equal(0ul, errorInfo.ExtraErrorInfo); + Assert.Equal(0ul, addressInfo.ForceMappedDspAddress); - Assert.IsTrue(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); + Assert.True(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); - Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); - Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); - Assert.AreEqual(DspAddress, addressInfo.ForceMappedDspAddress); + Assert.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); + Assert.Equal(CpuAddress, errorInfo.ExtraErrorInfo); + Assert.Equal(DspAddress, addressInfo.ForceMappedDspAddress); poolMapper = new PoolMapper(DummyProcessHandle, false); - Assert.IsFalse(poolMapper.TryAttachBuffer(out _, ref addressInfo, 0, 0)); + Assert.False(poolMapper.TryAttachBuffer(out _, ref addressInfo, 0, 0)); addressInfo.ForceMappedDspAddress = 0; - Assert.IsFalse(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); + Assert.False(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); - Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); - Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); - Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); + Assert.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); + Assert.Equal(CpuAddress, errorInfo.ExtraErrorInfo); + Assert.Equal(0ul, addressInfo.ForceMappedDspAddress); poolMapper = new PoolMapper(DummyProcessHandle, memoryPoolStateArray.AsMemory(), false); - Assert.IsFalse(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddressRegionEnding, CpuSize)); + Assert.False(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddressRegionEnding, CpuSize)); - Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); - Assert.AreEqual(CpuAddressRegionEnding, errorInfo.ExtraErrorInfo); - Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); - Assert.IsFalse(addressInfo.HasMemoryPoolState); + Assert.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); + Assert.Equal(CpuAddressRegionEnding, errorInfo.ExtraErrorInfo); + Assert.Equal(0ul, addressInfo.ForceMappedDspAddress); + Assert.False(addressInfo.HasMemoryPoolState); - Assert.IsTrue(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); + Assert.True(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); - Assert.AreEqual(ResultCode.Success, errorInfo.ErrorCode); - Assert.AreEqual(0, errorInfo.ExtraErrorInfo); - Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); - Assert.IsTrue(addressInfo.HasMemoryPoolState); + Assert.Equal(ResultCode.Success, errorInfo.ErrorCode); + Assert.Equal(0ul, errorInfo.ExtraErrorInfo); + Assert.Equal(0ul, addressInfo.ForceMappedDspAddress); + Assert.True(addressInfo.HasMemoryPoolState); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterDestinationTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterDestinationTests.cs index ad974aab1..733a5c978 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterDestinationTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterDestinationTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Splitter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class SplitterDestinationTests + public class SplitterDestinationTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0xE0, Unsafe.SizeOf()); + Assert.Equal(0xE0, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterStateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterStateTests.cs index 0421bd9d1..a33ab8717 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterStateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/SplitterStateTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Splitter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class SplitterStateTests + public class SplitterStateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x20, Unsafe.SizeOf()); + Assert.Equal(0x20, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceChannelResourceTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceChannelResourceTests.cs index 565ac7a69..46731956f 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceChannelResourceTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceChannelResourceTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Voice; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class VoiceChannelResourceTests + public class VoiceChannelResourceTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0xD0, Unsafe.SizeOf()); + Assert.Equal(0xD0, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceStateTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceStateTests.cs index dbd6eff8f..9d9fc6a77 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceStateTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/VoiceStateTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Voice; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class VoiceStateTests + public class VoiceStateTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.LessOrEqual(Unsafe.SizeOf(), 0x220); + Assert.True(0x220 >= Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/WaveBufferTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/WaveBufferTests.cs index 0e2ed0e85..149731144 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/Server/WaveBufferTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/WaveBufferTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Server.Voice; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer.Server { - class WaveBufferTests + public class WaveBufferTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x58, Unsafe.SizeOf()); + Assert.Equal(0x58, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/VoiceChannelResourceInParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/VoiceChannelResourceInParameterTests.cs index 2bcfd32c3..d0de043ab 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/VoiceChannelResourceInParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/VoiceChannelResourceInParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class VoiceChannelResourceInParameterTests + public class VoiceChannelResourceInParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x70, Unsafe.SizeOf()); + Assert.Equal(0x70, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/VoiceInParameterTests.cs b/src/Ryujinx.Tests/Audio/Renderer/VoiceInParameterTests.cs index 239da195a..0ba34e8a8 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/VoiceInParameterTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/VoiceInParameterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class VoiceInParameterTests + public class VoiceInParameterTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x170, Unsafe.SizeOf()); + Assert.Equal(0x170, Unsafe.SizeOf()); } } } diff --git a/src/Ryujinx.Tests/Audio/Renderer/VoiceOutStatusTests.cs b/src/Ryujinx.Tests/Audio/Renderer/VoiceOutStatusTests.cs index 1579d89b5..de1838d9e 100644 --- a/src/Ryujinx.Tests/Audio/Renderer/VoiceOutStatusTests.cs +++ b/src/Ryujinx.Tests/Audio/Renderer/VoiceOutStatusTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; using Ryujinx.Audio.Renderer.Parameter; using System.Runtime.CompilerServices; +using Xunit; namespace Ryujinx.Tests.Audio.Renderer { - class VoiceOutStatusTests + public class VoiceOutStatusTests { - [Test] + [Fact] public void EnsureTypeSize() { - Assert.AreEqual(0x10, Unsafe.SizeOf()); + Assert.Equal(0x10, Unsafe.SizeOf()); } } }