From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- .../Audio/Renderer/Server/AddressInfoTests.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs (limited to 'src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs') diff --git a/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs b/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs new file mode 100644 index 00000000..7c6b6526 --- /dev/null +++ b/src/Ryujinx.Tests/Audio/Renderer/Server/AddressInfoTests.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using Ryujinx.Audio.Renderer.Server.MemoryPool; +using System; +using System.Runtime.CompilerServices; + +namespace Ryujinx.Tests.Audio.Renderer.Server +{ + class AddressInfoTests + { + [Test] + public void EnsureTypeSize() + { + Assert.AreEqual(0x20, Unsafe.SizeOf()); + } + + [Test] + public void TestGetReference() + { + MemoryPoolState[] memoryPoolState = new MemoryPoolState[1]; + memoryPoolState[0] = MemoryPoolState.Create(MemoryPoolState.LocationType.Cpu); + memoryPoolState[0].SetCpuAddress(0x1000000, 0x10000); + memoryPoolState[0].DspAddress = 0x4000000; + + AddressInfo addressInfo = AddressInfo.Create(0x1000000, 0x1000); + + addressInfo.ForceMappedDspAddress = 0x2000000; + + Assert.AreEqual(0x2000000, addressInfo.GetReference(true)); + + addressInfo.SetupMemoryPool(memoryPoolState.AsSpan()); + + Assert.AreEqual(0x4000000, addressInfo.GetReference(true)); + } + } +} -- cgit v1.2.3