mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-08 20:02:39 +00:00
Convert Ryujinx.Tests.Audio.Renderer tests to xUnit
This commit is contained in:
parent
4d37b75f95
commit
a6b21cf613
|
@ -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<AudioRendererConfiguration>());
|
||||
Assert.Equal(0x34, Unsafe.SizeOf<AudioRendererConfiguration>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BehaviourParameter>());
|
||||
Assert.AreEqual(0x10, Unsafe.SizeOf<BehaviourParameter.ErrorInfo>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<BehaviourParameter>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<BehaviourParameter.ErrorInfo>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BiquadFilterParameter>());
|
||||
Assert.Equal(0xC, Unsafe.SizeOf<BiquadFilterParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<UpdateDataHeader>());
|
||||
Assert.Equal(0x40, Unsafe.SizeOf<UpdateDataHeader>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceUpdateState>(), 0x100);
|
||||
Assert.True(Unsafe.SizeOf<VoiceUpdateState>() <= 0x100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<WaveBuffer>());
|
||||
Assert.Equal(0x30, Unsafe.SizeOf<WaveBuffer>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<EffectInParameterVersion1>());
|
||||
Assert.AreEqual(0xC0, Unsafe.SizeOf<EffectInParameterVersion2>());
|
||||
Assert.Equal(0xC0, Unsafe.SizeOf<EffectInParameterVersion1>());
|
||||
Assert.Equal(0xC0, Unsafe.SizeOf<EffectInParameterVersion2>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<EffectOutStatusVersion1>());
|
||||
Assert.AreEqual(0x90, Unsafe.SizeOf<EffectOutStatusVersion2>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<EffectOutStatusVersion1>());
|
||||
Assert.Equal(0x90, Unsafe.SizeOf<EffectOutStatusVersion2>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MemoryPoolInParameter>());
|
||||
Assert.AreEqual(0x10, Unsafe.SizeOf<MemoryPoolOutStatus>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<MemoryPoolInParameter>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<MemoryPoolOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BehaviourErrorInfoOutStatus>());
|
||||
Assert.Equal(0xB0, Unsafe.SizeOf<BehaviourErrorInfoOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<AuxiliaryBufferParameter>());
|
||||
Assert.Equal(0x6C, Unsafe.SizeOf<AuxiliaryBufferParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BiquadFilterEffectParameter>());
|
||||
Assert.Equal(0x18, Unsafe.SizeOf<BiquadFilterEffectParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BufferMixParameter>());
|
||||
Assert.Equal(0x94, Unsafe.SizeOf<BufferMixParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<CompressorParameter>());
|
||||
Assert.Equal(0x38, Unsafe.SizeOf<CompressorParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<DelayParameter>());
|
||||
Assert.Equal(0x35, Unsafe.SizeOf<DelayParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<LimiterParameter>());
|
||||
Assert.Equal(0x44, Unsafe.SizeOf<LimiterParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<LimiterStatistics>());
|
||||
Assert.Equal(0x30, Unsafe.SizeOf<LimiterStatistics>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Reverb3dParameter>());
|
||||
Assert.Equal(0x49, Unsafe.SizeOf<Reverb3dParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<ReverbParameter>());
|
||||
Assert.Equal(0x41, Unsafe.SizeOf<ReverbParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MixInParameterDirtyOnlyUpdate>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<MixInParameterDirtyOnlyUpdate>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MixParameter>());
|
||||
Assert.Equal(0x930, Unsafe.SizeOf<MixParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<PerformanceInParameter>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<PerformanceInParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<PerformanceOutStatus>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<PerformanceOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<RendererInfoOutStatus>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<RendererInfoOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<CircularBufferParameter>());
|
||||
Assert.Equal(0x24, Unsafe.SizeOf<CircularBufferParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<DeviceParameter>());
|
||||
Assert.Equal(0x11C, Unsafe.SizeOf<DeviceParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<SinkInParameter>());
|
||||
Assert.Equal(0x140, Unsafe.SizeOf<SinkInParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<SinkOutStatus>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<SinkOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<SplitterInParameterHeader>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<SplitterInParameterHeader>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<AddressInfo>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<AddressInfo>());
|
||||
}
|
||||
|
||||
[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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MemoryPoolState>(), 0x20);
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<MemoryPoolState>());
|
||||
}
|
||||
|
||||
[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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MixState>());
|
||||
Assert.Equal(0x940, Unsafe.SizeOf<MixState>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<SplitterDestination>());
|
||||
Assert.Equal(0xE0, Unsafe.SizeOf<SplitterDestination>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<SplitterState>());
|
||||
Assert.Equal(0x20, Unsafe.SizeOf<SplitterState>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceChannelResource>());
|
||||
Assert.Equal(0xD0, Unsafe.SizeOf<VoiceChannelResource>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceState>(), 0x220);
|
||||
Assert.True(0x220 >= Unsafe.SizeOf<VoiceState>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<WaveBuffer>());
|
||||
Assert.Equal(0x58, Unsafe.SizeOf<WaveBuffer>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceChannelResourceInParameter>());
|
||||
Assert.Equal(0x70, Unsafe.SizeOf<VoiceChannelResourceInParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceInParameter>());
|
||||
Assert.Equal(0x170, Unsafe.SizeOf<VoiceInParameter>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<VoiceOutStatus>());
|
||||
Assert.Equal(0x10, Unsafe.SizeOf<VoiceOutStatus>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue