Convert Ryujinx.Tests.Audio.Renderer tests to xUnit

This commit is contained in:
TSR Berry 2023-07-08 20:20:47 +02:00
parent 4d37b75f95
commit a6b21cf613
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2
44 changed files with 420 additions and 420 deletions

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class AudioRendererConfigurationTests public class AudioRendererConfigurationTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x34, Unsafe.SizeOf<AudioRendererConfiguration>()); Assert.Equal(0x34, Unsafe.SizeOf<AudioRendererConfiguration>());
} }
} }
} }

View file

@ -1,16 +1,16 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class BehaviourParameterTests public class BehaviourParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<BehaviourParameter>()); Assert.Equal(0x10, Unsafe.SizeOf<BehaviourParameter>());
Assert.AreEqual(0x10, Unsafe.SizeOf<BehaviourParameter.ErrorInfo>()); Assert.Equal(0x10, Unsafe.SizeOf<BehaviourParameter.ErrorInfo>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class BiquadFilterParameterTests public class BiquadFilterParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xC, Unsafe.SizeOf<BiquadFilterParameter>()); Assert.Equal(0xC, Unsafe.SizeOf<BiquadFilterParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Common namespace Ryujinx.Tests.Audio.Renderer.Common
{ {
class UpdateDataHeaderTests public class UpdateDataHeaderTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x40, Unsafe.SizeOf<UpdateDataHeader>()); Assert.Equal(0x40, Unsafe.SizeOf<UpdateDataHeader>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Common namespace Ryujinx.Tests.Audio.Renderer.Common
{ {
class VoiceUpdateStateTests public class VoiceUpdateStateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.LessOrEqual(Unsafe.SizeOf<VoiceUpdateState>(), 0x100); Assert.True(Unsafe.SizeOf<VoiceUpdateState>() <= 0x100);
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Common namespace Ryujinx.Tests.Audio.Renderer.Common
{ {
class WaveBufferTests public class WaveBufferTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x30, Unsafe.SizeOf<WaveBuffer>()); Assert.Equal(0x30, Unsafe.SizeOf<WaveBuffer>());
} }
} }
} }

View file

@ -1,25 +1,25 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Dsp; using Ryujinx.Audio.Renderer.Dsp;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System; using System;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Dsp namespace Ryujinx.Tests.Audio.Renderer.Dsp
{ {
class ResamplerTests public class ResamplerTests
{ {
[Test] [Theory]
[TestCase(VoiceInParameter.SampleRateConversionQuality.Low)] [InlineData(VoiceInParameter.SampleRateConversionQuality.Low)]
[TestCase(VoiceInParameter.SampleRateConversionQuality.Default)] [InlineData(VoiceInParameter.SampleRateConversionQuality.Default)]
[TestCase(VoiceInParameter.SampleRateConversionQuality.High)] [InlineData(VoiceInParameter.SampleRateConversionQuality.High)]
public void TestResamplerConsistencyUpsampling(VoiceInParameter.SampleRateConversionQuality quality) public void TestResamplerConsistencyUpsampling(VoiceInParameter.SampleRateConversionQuality quality)
{ {
DoResamplingTest(44100, 48000, quality); DoResamplingTest(44100, 48000, quality);
} }
[Test] [Theory]
[TestCase(VoiceInParameter.SampleRateConversionQuality.Low)] [InlineData(VoiceInParameter.SampleRateConversionQuality.Low)]
[TestCase(VoiceInParameter.SampleRateConversionQuality.Default)] [InlineData(VoiceInParameter.SampleRateConversionQuality.Default)]
[TestCase(VoiceInParameter.SampleRateConversionQuality.High)] [InlineData(VoiceInParameter.SampleRateConversionQuality.High)]
public void TestResamplerConsistencyDownsampling(VoiceInParameter.SampleRateConversionQuality quality) public void TestResamplerConsistencyDownsampling(VoiceInParameter.SampleRateConversionQuality quality)
{ {
DoResamplingTest(48000, 44100, quality); DoResamplingTest(48000, 44100, quality);
@ -74,13 +74,13 @@ namespace Ryujinx.Tests.Audio.Renderer.Dsp
float thisDelta = Math.Abs(expectedOutput[sample] - outputBuffer[sample]); float thisDelta = Math.Abs(expectedOutput[sample] - outputBuffer[sample]);
// Ensure no discontinuities // Ensure no discontinuities
Assert.IsTrue(thisDelta < 0.1f); Assert.True(thisDelta < 0.1f);
sumDifference += thisDelta; sumDifference += thisDelta;
} }
sumDifference /= outputSampleCount; sumDifference /= outputSampleCount;
// Expect the output to be 99% similar to the expected resampled sine wave // Expect the output to be 99% similar to the expected resampled sine wave
Assert.IsTrue(sumDifference < 0.01f); Assert.True(sumDifference < 0.01f);
} }
} }
} }

View file

@ -1,13 +1,13 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Dsp; using Ryujinx.Audio.Renderer.Dsp;
using Ryujinx.Audio.Renderer.Server.Upsampler; using Ryujinx.Audio.Renderer.Server.Upsampler;
using System; using System;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Dsp namespace Ryujinx.Tests.Audio.Renderer.Dsp
{ {
class UpsamplerTests public class UpsamplerTests
{ {
[Test] [Fact]
public void TestUpsamplerConsistency() public void TestUpsamplerConsistency()
{ {
UpsamplerBufferState bufferState = new(); UpsamplerBufferState bufferState = new();
@ -51,7 +51,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Dsp
sumDifference /= expectedOutput.Length; sumDifference /= expectedOutput.Length;
// Expect the output to be 98% similar to the expected resampled sine wave // Expect the output to be 98% similar to the expected resampled sine wave
Assert.IsTrue(sumDifference < 0.02f); Assert.True(sumDifference < 0.02f);
} }
} }
} }

View file

@ -1,16 +1,16 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class EffectInfoParameterTests public class EffectInfoParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xC0, Unsafe.SizeOf<EffectInParameterVersion1>()); Assert.Equal(0xC0, Unsafe.SizeOf<EffectInParameterVersion1>());
Assert.AreEqual(0xC0, Unsafe.SizeOf<EffectInParameterVersion2>()); Assert.Equal(0xC0, Unsafe.SizeOf<EffectInParameterVersion2>());
} }
} }
} }

View file

@ -1,16 +1,16 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class EffectOutStatusTests public class EffectOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<EffectOutStatusVersion1>()); Assert.Equal(0x10, Unsafe.SizeOf<EffectOutStatusVersion1>());
Assert.AreEqual(0x90, Unsafe.SizeOf<EffectOutStatusVersion2>()); Assert.Equal(0x90, Unsafe.SizeOf<EffectOutStatusVersion2>());
} }
} }
} }

View file

@ -1,16 +1,16 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class MemoryPoolParameterTests public class MemoryPoolParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<MemoryPoolInParameter>()); Assert.Equal(0x20, Unsafe.SizeOf<MemoryPoolInParameter>());
Assert.AreEqual(0x10, Unsafe.SizeOf<MemoryPoolOutStatus>()); Assert.Equal(0x10, Unsafe.SizeOf<MemoryPoolOutStatus>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class BehaviourErrorInfoOutStatusTests public class BehaviourErrorInfoOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xB0, Unsafe.SizeOf<BehaviourErrorInfoOutStatus>()); Assert.Equal(0xB0, Unsafe.SizeOf<BehaviourErrorInfoOutStatus>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class AuxParameterTests public class AuxParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x6C, Unsafe.SizeOf<AuxiliaryBufferParameter>()); Assert.Equal(0x6C, Unsafe.SizeOf<AuxiliaryBufferParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class BiquadFilterEffectParameterTests public class BiquadFilterEffectParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x18, Unsafe.SizeOf<BiquadFilterEffectParameter>()); Assert.Equal(0x18, Unsafe.SizeOf<BiquadFilterEffectParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class BufferMixerParameterTests public class BufferMixerParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x94, Unsafe.SizeOf<BufferMixParameter>()); Assert.Equal(0x94, Unsafe.SizeOf<BufferMixParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class CompressorParameterTests public class CompressorParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x38, Unsafe.SizeOf<CompressorParameter>()); Assert.Equal(0x38, Unsafe.SizeOf<CompressorParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class DelayParameterTests public class DelayParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x35, Unsafe.SizeOf<DelayParameter>()); Assert.Equal(0x35, Unsafe.SizeOf<DelayParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class LimiterParameterTests public class LimiterParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x44, Unsafe.SizeOf<LimiterParameter>()); Assert.Equal(0x44, Unsafe.SizeOf<LimiterParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class LimiterStatisticsTests public class LimiterStatisticsTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x30, Unsafe.SizeOf<LimiterStatistics>()); Assert.Equal(0x30, Unsafe.SizeOf<LimiterStatistics>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class Reverb3dParameterTests public class Reverb3dParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x49, Unsafe.SizeOf<Reverb3dParameter>()); Assert.Equal(0x49, Unsafe.SizeOf<Reverb3dParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Effect; using Ryujinx.Audio.Renderer.Parameter.Effect;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
{ {
class ReverbParameterTests public class ReverbParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x41, Unsafe.SizeOf<ReverbParameter>()); Assert.Equal(0x41, Unsafe.SizeOf<ReverbParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class MixInParameterDirtyOnlyUpdateTests public class MixInParameterDirtyOnlyUpdateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<MixInParameterDirtyOnlyUpdate>()); Assert.Equal(0x20, Unsafe.SizeOf<MixInParameterDirtyOnlyUpdate>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class MixParameterTests public class MixParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x930, Unsafe.SizeOf<MixParameter>()); Assert.Equal(0x930, Unsafe.SizeOf<MixParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Performance; using Ryujinx.Audio.Renderer.Parameter.Performance;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class PerformanceInParameterTests public class PerformanceInParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<PerformanceInParameter>()); Assert.Equal(0x10, Unsafe.SizeOf<PerformanceInParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Performance; using Ryujinx.Audio.Renderer.Parameter.Performance;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class PerformanceOutStatusTests public class PerformanceOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<PerformanceOutStatus>()); Assert.Equal(0x10, Unsafe.SizeOf<PerformanceOutStatus>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class RendererInfoOutStatusTests public class RendererInfoOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<RendererInfoOutStatus>()); Assert.Equal(0x10, Unsafe.SizeOf<RendererInfoOutStatus>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Sink; using Ryujinx.Audio.Renderer.Parameter.Sink;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink
{ {
class CircularBufferParameterTests public class CircularBufferParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x24, Unsafe.SizeOf<CircularBufferParameter>()); Assert.Equal(0x24, Unsafe.SizeOf<CircularBufferParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter.Sink; using Ryujinx.Audio.Renderer.Parameter.Sink;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink
{ {
class DeviceParameterTests public class DeviceParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x11C, Unsafe.SizeOf<DeviceParameter>()); Assert.Equal(0x11C, Unsafe.SizeOf<DeviceParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class SinkInParameterTests public class SinkInParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x140, Unsafe.SizeOf<SinkInParameter>()); Assert.Equal(0x140, Unsafe.SizeOf<SinkInParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class SinkOutStatusTests public class SinkOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SinkOutStatus>()); Assert.Equal(0x20, Unsafe.SizeOf<SinkOutStatus>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Parameter namespace Ryujinx.Tests.Audio.Renderer.Parameter
{ {
class SplitterInParamHeaderTests public class SplitterInParamHeaderTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SplitterInParameterHeader>()); Assert.Equal(0x20, Unsafe.SizeOf<SplitterInParameterHeader>());
} }
} }
} }

View file

@ -1,19 +1,19 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.MemoryPool; using Ryujinx.Audio.Renderer.Server.MemoryPool;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class AddressInfoTests public class AddressInfoTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<AddressInfo>()); Assert.Equal(0x20, Unsafe.SizeOf<AddressInfo>());
} }
[Test] [Fact]
public void TestGetReference() public void TestGetReference()
{ {
MemoryPoolState[] memoryPoolState = new MemoryPoolState[1]; MemoryPoolState[] memoryPoolState = new MemoryPoolState[1];
@ -25,11 +25,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
addressInfo.ForceMappedDspAddress = 0x2000000; addressInfo.ForceMappedDspAddress = 0x2000000;
Assert.AreEqual(0x2000000, addressInfo.GetReference(true)); Assert.Equal(0x2000000ul, addressInfo.GetReference(true));
addressInfo.SetupMemoryPool(memoryPoolState.AsSpan()); addressInfo.SetupMemoryPool(memoryPoolState.AsSpan());
Assert.AreEqual(0x4000000, addressInfo.GetReference(true)); Assert.Equal(0x4000000ul, addressInfo.GetReference(true));
} }
} }
} }

View file

@ -1,296 +1,296 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server; using Ryujinx.Audio.Renderer.Server;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
public class BehaviourContextTests public class BehaviourContextTests
{ {
[Test] [Fact]
public void TestCheckFeature() public void TestCheckFeature()
{ {
int latestRevision = BehaviourContext.BaseRevisionMagic + BehaviourContext.LastRevision; int latestRevision = BehaviourContext.BaseRevisionMagic + BehaviourContext.LastRevision;
int previousRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision - 1); int previousRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision - 1);
int invalidRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision + 1); int invalidRevision = BehaviourContext.BaseRevisionMagic + (BehaviourContext.LastRevision + 1);
Assert.IsTrue(BehaviourContext.CheckFeatureSupported(latestRevision, latestRevision)); Assert.True(BehaviourContext.CheckFeatureSupported(latestRevision, latestRevision));
Assert.IsFalse(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision)); Assert.False(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision));
Assert.IsTrue(BehaviourContext.CheckFeatureSupported(latestRevision, previousRevision)); 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.. // 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() public void TestsMemoryPoolForceMappingEnabled()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1);
Assert.IsFalse(behaviourContext.IsMemoryPoolForceMappingEnabled()); Assert.False(behaviourContext.IsMemoryPoolForceMappingEnabled());
behaviourContext.UpdateFlags(0x1); behaviourContext.UpdateFlags(0x1);
Assert.IsTrue(behaviourContext.IsMemoryPoolForceMappingEnabled()); Assert.True(behaviourContext.IsMemoryPoolForceMappingEnabled());
} }
[Test] [Fact]
public void TestRevision1() public void TestRevision1()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1);
Assert.IsFalse(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.False(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsFalse(behaviourContext.IsSplitterSupported()); Assert.False(behaviourContext.IsSplitterSupported());
Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); Assert.False(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.False(behaviourContext.IsSplitterBugFixed());
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.False(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision2() public void TestRevision2()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision2); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision2);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); Assert.False(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.False(behaviourContext.IsSplitterBugFixed());
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.False(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision3() public void TestRevision3()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision3); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision3);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.False(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.False(behaviourContext.IsSplitterBugFixed());
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.False(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision4() public void TestRevision4()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.False(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.False(behaviourContext.IsSplitterBugFixed());
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.False(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.False(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(1u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision5() public void TestRevision5()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision5); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision5);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.False(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision6() public void TestRevision6()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision6); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision6);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.False(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision7() public void TestRevision7()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision7); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision7);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.False(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision8() public void TestRevision8()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision8); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision8);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.True(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.False(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision9() public void TestRevision9()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision9); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision9);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.True(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.True(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsFalse(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.False(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
[Test] [Fact]
public void TestRevision10() public void TestRevision10()
{ {
BehaviourContext behaviourContext = new(); BehaviourContext behaviourContext = new();
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision10); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision10);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.True(behaviourContext.IsAdpcmLoopContextBugFixed());
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.True(behaviourContext.IsSplitterSupported());
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.True(behaviourContext.IsLongSizePreDelaySupported());
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.True(behaviourContext.IsAudioUsbDeviceOutputSupported());
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.True(behaviourContext.IsFlushVoiceWaveBuffersSupported());
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.True(behaviourContext.IsSplitterBugFixed());
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.True(behaviourContext.IsElapsedFrameCountSupported());
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.True(behaviourContext.IsDecodingBehaviourFlagSupported());
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.True(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.True(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.True(behaviourContext.IsWaveBufferVersion2Supported());
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.True(behaviourContext.IsEffectInfoVersion2Supported());
Assert.IsTrue(behaviourContext.IsBiquadFilterGroupedOptimizationSupported()); Assert.True(behaviourContext.IsBiquadFilterGroupedOptimizationSupported());
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.Equal(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit());
Assert.AreEqual(4, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.Equal(4, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.Equal(2u, behaviourContext.GetPerformanceMetricsDataFormat());
} }
} }
} }

View file

@ -1,18 +1,18 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.MemoryPool; using Ryujinx.Audio.Renderer.Server.MemoryPool;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class MemoryPoolStateTests public class MemoryPoolStateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(Unsafe.SizeOf<MemoryPoolState>(), 0x20); Assert.Equal(0x20, Unsafe.SizeOf<MemoryPoolState>());
} }
[Test] [Fact]
public void TestContains() public void TestContains()
{ {
MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu);
@ -21,15 +21,15 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.IsTrue(memoryPool.Contains(0x1000000, 0x10)); Assert.True(memoryPool.Contains(0x1000000, 0x10));
Assert.IsTrue(memoryPool.Contains(0x1000FE0, 0x10)); Assert.True(memoryPool.Contains(0x1000FE0, 0x10));
Assert.IsTrue(memoryPool.Contains(0x1000FFF, 0x1)); Assert.True(memoryPool.Contains(0x1000FFF, 0x1));
Assert.IsFalse(memoryPool.Contains(0x1000FFF, 0x2)); Assert.False(memoryPool.Contains(0x1000FFF, 0x2));
Assert.IsFalse(memoryPool.Contains(0x1001000, 0x10)); Assert.False(memoryPool.Contains(0x1001000, 0x10));
Assert.IsFalse(memoryPool.Contains(0x2000000, 0x10)); Assert.False(memoryPool.Contains(0x2000000, 0x10));
} }
[Test] [Fact]
public void TestTranslate() public void TestTranslate()
{ {
MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu);
@ -38,25 +38,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.AreEqual(0x2000FE0, memoryPool.Translate(0x1000FE0, 0x10)); Assert.Equal(0x2000FE0ul, memoryPool.Translate(0x1000FE0, 0x10));
Assert.AreEqual(0x2000FFF, memoryPool.Translate(0x1000FFF, 0x1)); Assert.Equal(0x2000FFFul, memoryPool.Translate(0x1000FFF, 0x1));
Assert.AreEqual(0x0, memoryPool.Translate(0x1000FFF, 0x2)); Assert.Equal(0x0ul, memoryPool.Translate(0x1000FFF, 0x2));
Assert.AreEqual(0x0, memoryPool.Translate(0x1001000, 0x10)); Assert.Equal(0x0ul, memoryPool.Translate(0x1001000, 0x10));
Assert.AreEqual(0x0, memoryPool.Translate(0x2000000, 0x10)); Assert.Equal(0x0ul, memoryPool.Translate(0x2000000, 0x10));
} }
[Test] [Fact]
public void TestIsMapped() public void TestIsMapped()
{ {
MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); MemoryPoolState memoryPool = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu);
memoryPool.SetCpuAddress(0x1000000, 0x1000); memoryPool.SetCpuAddress(0x1000000, 0x1000);
Assert.IsFalse(memoryPool.IsMapped()); Assert.False(memoryPool.IsMapped());
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.IsTrue(memoryPool.IsMapped()); Assert.True(memoryPool.IsMapped());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Mix; using Ryujinx.Audio.Renderer.Server.Mix;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class MixStateTests public class MixStateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x940, Unsafe.SizeOf<MixState>()); Assert.Equal(0x940, Unsafe.SizeOf<MixState>());
} }
} }
} }

View file

@ -1,18 +1,18 @@
using NUnit.Framework;
using Ryujinx.Audio; using Ryujinx.Audio;
using Ryujinx.Audio.Renderer.Server.MemoryPool; using Ryujinx.Audio.Renderer.Server.MemoryPool;
using System; using System;
using Xunit;
using static Ryujinx.Audio.Renderer.Common.BehaviourParameter; using static Ryujinx.Audio.Renderer.Common.BehaviourParameter;
using CpuAddress = System.UInt64; using CpuAddress = System.UInt64;
using DspAddress = System.UInt64; using DspAddress = System.UInt64;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class PoolMapperTests public class PoolMapperTests
{ {
private const uint DummyProcessHandle = 0xCAFEBABE; private const uint DummyProcessHandle = 0xCAFEBABE;
[Test] [Fact]
public void TestInitializeSystemPool() public void TestInitializeSystemPool()
{ {
PoolMapper poolMapper = new(DummyProcessHandle, true); PoolMapper poolMapper = new(DummyProcessHandle, true);
@ -23,26 +23,26 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
const DspAddress DspAddress = CpuAddress; // TODO: DSP LLE const DspAddress DspAddress = CpuAddress; // TODO: DSP LLE
const ulong CpuSize = 0x1000; const ulong CpuSize = 0x1000;
Assert.IsFalse(poolMapper.InitializeSystemPool(ref memoryPoolCpu, CpuAddress, CpuSize)); Assert.False(poolMapper.InitializeSystemPool(ref memoryPoolCpu, CpuAddress, CpuSize));
Assert.IsTrue(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize)); Assert.True(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize));
Assert.AreEqual(CpuAddress, memoryPoolDsp.CpuAddress); Assert.Equal(CpuAddress, memoryPoolDsp.CpuAddress);
Assert.AreEqual(CpuSize, memoryPoolDsp.Size); Assert.Equal(CpuSize, memoryPoolDsp.Size);
Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); Assert.Equal(DspAddress, memoryPoolDsp.DspAddress);
} }
[Test] [Fact]
public void TestGetProcessHandle() public void TestGetProcessHandle()
{ {
PoolMapper poolMapper = new(DummyProcessHandle, true); PoolMapper poolMapper = new(DummyProcessHandle, true);
MemoryPoolState memoryPoolDsp = MemoryPoolState.Create(MemoryPoolState.LocationType.Dsp); MemoryPoolState memoryPoolDsp = MemoryPoolState.Create(MemoryPoolState.LocationType.Dsp);
MemoryPoolState memoryPoolCpu = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); MemoryPoolState memoryPoolCpu = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu);
Assert.AreEqual(0xFFFF8001, poolMapper.GetProcessHandle(ref memoryPoolCpu)); Assert.Equal(0xFFFF8001, poolMapper.GetProcessHandle(ref memoryPoolCpu));
Assert.AreEqual(DummyProcessHandle, poolMapper.GetProcessHandle(ref memoryPoolDsp)); Assert.Equal(DummyProcessHandle, poolMapper.GetProcessHandle(ref memoryPoolDsp));
} }
[Test] [Fact]
public void TestMappings() public void TestMappings()
{ {
PoolMapper poolMapper = new(DummyProcessHandle, true); PoolMapper poolMapper = new(DummyProcessHandle, true);
@ -56,18 +56,18 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPoolDsp.SetCpuAddress(CpuAddress, CpuSize); memoryPoolDsp.SetCpuAddress(CpuAddress, CpuSize);
memoryPoolCpu.SetCpuAddress(CpuAddress, CpuSize); memoryPoolCpu.SetCpuAddress(CpuAddress, CpuSize);
Assert.AreEqual(DspAddress, poolMapper.Map(ref memoryPoolCpu)); Assert.Equal(DspAddress, poolMapper.Map(ref memoryPoolCpu));
Assert.AreEqual(DspAddress, poolMapper.Map(ref memoryPoolDsp)); Assert.Equal(DspAddress, poolMapper.Map(ref memoryPoolDsp));
Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); Assert.Equal(DspAddress, memoryPoolDsp.DspAddress);
Assert.IsTrue(poolMapper.Unmap(ref memoryPoolCpu)); Assert.True(poolMapper.Unmap(ref memoryPoolCpu));
memoryPoolDsp.IsUsed = true; memoryPoolDsp.IsUsed = true;
Assert.IsFalse(poolMapper.Unmap(ref memoryPoolDsp)); Assert.False(poolMapper.Unmap(ref memoryPoolDsp));
memoryPoolDsp.IsUsed = false; memoryPoolDsp.IsUsed = false;
Assert.IsTrue(poolMapper.Unmap(ref memoryPoolDsp)); Assert.True(poolMapper.Unmap(ref memoryPoolDsp));
} }
[Test] [Fact]
public void TestTryAttachBuffer() public void TestTryAttachBuffer()
{ {
const CpuAddress CpuAddress = 0x20000; const CpuAddress CpuAddress = 0x20000;
@ -90,45 +90,45 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
PoolMapper poolMapper = new(DummyProcessHandle, true); 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.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode);
Assert.AreEqual(0, errorInfo.ExtraErrorInfo); Assert.Equal(0ul, errorInfo.ExtraErrorInfo);
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); 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.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode);
Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); Assert.Equal(CpuAddress, errorInfo.ExtraErrorInfo);
Assert.AreEqual(DspAddress, addressInfo.ForceMappedDspAddress); Assert.Equal(DspAddress, addressInfo.ForceMappedDspAddress);
poolMapper = new PoolMapper(DummyProcessHandle, false); 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; 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.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode);
Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); Assert.Equal(CpuAddress, errorInfo.ExtraErrorInfo);
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.Equal(0ul, addressInfo.ForceMappedDspAddress);
poolMapper = new PoolMapper(DummyProcessHandle, memoryPoolStateArray.AsMemory(), false); 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.Equal(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode);
Assert.AreEqual(CpuAddressRegionEnding, errorInfo.ExtraErrorInfo); Assert.Equal(CpuAddressRegionEnding, errorInfo.ExtraErrorInfo);
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.Equal(0ul, addressInfo.ForceMappedDspAddress);
Assert.IsFalse(addressInfo.HasMemoryPoolState); 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.Equal(ResultCode.Success, errorInfo.ErrorCode);
Assert.AreEqual(0, errorInfo.ExtraErrorInfo); Assert.Equal(0ul, errorInfo.ExtraErrorInfo);
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.Equal(0ul, addressInfo.ForceMappedDspAddress);
Assert.IsTrue(addressInfo.HasMemoryPoolState); Assert.True(addressInfo.HasMemoryPoolState);
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Splitter; using Ryujinx.Audio.Renderer.Server.Splitter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class SplitterDestinationTests public class SplitterDestinationTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xE0, Unsafe.SizeOf<SplitterDestination>()); Assert.Equal(0xE0, Unsafe.SizeOf<SplitterDestination>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Splitter; using Ryujinx.Audio.Renderer.Server.Splitter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class SplitterStateTests public class SplitterStateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SplitterState>()); Assert.Equal(0x20, Unsafe.SizeOf<SplitterState>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Voice; using Ryujinx.Audio.Renderer.Server.Voice;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class VoiceChannelResourceTests public class VoiceChannelResourceTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xD0, Unsafe.SizeOf<VoiceChannelResource>()); Assert.Equal(0xD0, Unsafe.SizeOf<VoiceChannelResource>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Voice; using Ryujinx.Audio.Renderer.Server.Voice;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class VoiceStateTests public class VoiceStateTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.LessOrEqual(Unsafe.SizeOf<VoiceState>(), 0x220); Assert.True(0x220 >= Unsafe.SizeOf<VoiceState>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Server.Voice; using Ryujinx.Audio.Renderer.Server.Voice;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer.Server namespace Ryujinx.Tests.Audio.Renderer.Server
{ {
class WaveBufferTests public class WaveBufferTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x58, Unsafe.SizeOf<WaveBuffer>()); Assert.Equal(0x58, Unsafe.SizeOf<WaveBuffer>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class VoiceChannelResourceInParameterTests public class VoiceChannelResourceInParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x70, Unsafe.SizeOf<VoiceChannelResourceInParameter>()); Assert.Equal(0x70, Unsafe.SizeOf<VoiceChannelResourceInParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class VoiceInParameterTests public class VoiceInParameterTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x170, Unsafe.SizeOf<VoiceInParameter>()); Assert.Equal(0x170, Unsafe.SizeOf<VoiceInParameter>());
} }
} }
} }

View file

@ -1,15 +1,15 @@
using NUnit.Framework;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xunit;
namespace Ryujinx.Tests.Audio.Renderer namespace Ryujinx.Tests.Audio.Renderer
{ {
class VoiceOutStatusTests public class VoiceOutStatusTests
{ {
[Test] [Fact]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<VoiceOutStatus>()); Assert.Equal(0x10, Unsafe.SizeOf<VoiceOutStatus>());
} }
} }
} }