Update nuget packages and correct breaking changes

This commit is contained in:
Michael Savage 2024-08-07 22:50:20 +08:00
commit a57b3be2b7
76 changed files with 612 additions and 609 deletions

View file

@ -3,47 +3,47 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageVersion Include="Avalonia" Version="11.0.10" /> <PackageVersion Include="Avalonia" Version="11.1.2" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.10" /> <PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.1.2" />
<PackageVersion Include="Avalonia.Desktop" Version="11.0.10" /> <PackageVersion Include="Avalonia.Desktop" Version="11.1.2" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.10" /> <PackageVersion Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.0.10" /> <PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.1.2" />
<PackageVersion Include="Avalonia.Svg" Version="11.0.0.18" /> <PackageVersion Include="Avalonia.Svg" Version="11.1.0" />
<PackageVersion Include="Avalonia.Svg.Skia" Version="11.0.0.18" /> <PackageVersion Include="Avalonia.Svg.Skia" Version="11.1.0" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" /> <PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Concentus" Version="2.2.0" /> <PackageVersion Include="Concentus" Version="2.2.2" />
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" /> <PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageVersion Include="DynamicData" Version="9.0.1" /> <PackageVersion Include="DynamicData" Version="9.0.1" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" /> <PackageVersion Include="FluentAvaloniaUI" Version="2.1.0" />
<PackageVersion Include="GtkSharp.Dependencies" Version="1.1.1" /> <PackageVersion Include="GtkSharp.Dependencies" Version="1.1.1" />
<PackageVersion Include="GtkSharp.Dependencies.osx" Version="0.0.5" /> <PackageVersion Include="GtkSharp.Dependencies.osx" Version="0.0.5" />
<PackageVersion Include="LibHac" Version="0.19.0" /> <PackageVersion Include="LibHac" Version="0.19.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" /> <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" /> <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" /> <PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" /> <PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" /> <PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
<PackageVersion Include="NetCoreServer" Version="8.0.7" /> <PackageVersion Include="NetCoreServer" Version="8.0.7" />
<PackageVersion Include="NUnit" Version="3.13.3" /> <PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.1.0" /> <PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="OpenTK.Core" Version="4.8.2" /> <PackageVersion Include="OpenTK.Core" Version="4.8.2" />
<PackageVersion Include="OpenTK.Graphics" Version="4.8.2" /> <PackageVersion Include="OpenTK.Graphics" Version="4.8.2" />
<PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.8.2" /> <PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.8.2" />
<PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.8.2" /> <PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.8.2" />
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" /> <PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" /> <PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" /> <PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.3" />
<PackageVersion Include="Ryujinx.GtkSharp" Version="3.24.24.59-ryujinx" /> <PackageVersion Include="Ryujinx.GtkSharp" Version="3.24.24.59-ryujinx" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" /> <PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" /> <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="shaderc.net" Version="0.1.0" /> <PackageVersion Include="shaderc.net" Version="0.1.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" /> <PackageVersion Include="SharpZipLib" Version="1.4.2" />
<PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.21.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.8" /> <PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0" /> <PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageVersion Include="SPB" Version="0.0.4-build32" /> <PackageVersion Include="SPB" Version="0.0.4-build32" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" /> <PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
<PackageVersion Include="System.Management" Version="8.0.0" /> <PackageVersion Include="System.Management" Version="8.0.0" />

View file

@ -122,7 +122,7 @@ namespace Ryujinx.Graphics.Vulkan
Range = (uint)size, Range = (uint)size,
}; };
_gd.Api.CreateBufferView(_device, bufferViewCreateInfo, null, out var bufferView).ThrowOnError(); _gd.Api.CreateBufferView(_device, in bufferViewCreateInfo, null, out var bufferView).ThrowOnError();
return new Auto<DisposableBufferView>(new DisposableBufferView(_gd.Api, _device, bufferView), this, _waitable, _buffer); return new Auto<DisposableBufferView>(new DisposableBufferView(_gd.Api, _device, bufferView), this, _waitable, _buffer);
} }
@ -153,7 +153,7 @@ namespace Ryujinx.Graphics.Vulkan
PipelineStageFlags.AllCommandsBit, PipelineStageFlags.AllCommandsBit,
DependencyFlags.DeviceGroupBit, DependencyFlags.DeviceGroupBit,
1, 1,
memoryBarrier, in memoryBarrier,
0, 0,
null, null,
0, 0,
@ -770,7 +770,7 @@ namespace Ryujinx.Graphics.Vulkan
0, 0,
null, null,
1, 1,
memoryBarrier, in memoryBarrier,
0, 0,
null); null);
} }

View file

@ -221,7 +221,7 @@ namespace Ryujinx.Graphics.Vulkan
PBufferBinds = &bufferBind PBufferBinds = &bufferBind
}; };
gd.Api.QueueBindSparse(gd.Queue, 1, bindSparseInfo, default).ThrowOnError(); gd.Api.QueueBindSparse(gd.Queue, 1, in bindSparseInfo, default).ThrowOnError();
} }
var holder = new BufferHolder(gd, _device, buffer, (int)size, storageAllocations); var holder = new BufferHolder(gd, _device, buffer, (int)size, storageAllocations);

View file

@ -24,8 +24,10 @@ namespace Ryujinx.Graphics.Vulkan
if (_buffer != null) if (_buffer != null)
{ {
var buffer = _buffer.Get(cbs, _offset, _size, true).Value; var buffer = _buffer.Get(cbs, _offset, _size, true).Value;
var offset = (ulong)_offset;
var size = (ulong)_size;
gd.TransformFeedbackApi.CmdBindTransformFeedbackBuffers(cbs.CommandBuffer, binding, 1, buffer, (ulong)_offset, (ulong)_size); gd.TransformFeedbackApi.CmdBindTransformFeedbackBuffers(cbs.CommandBuffer, binding, 1, in buffer, in offset, in size);
} }
} }

View file

@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.Vulkan
Level = CommandBufferLevel.Primary, Level = CommandBufferLevel.Primary,
}; };
api.AllocateCommandBuffers(device, allocateInfo, out CommandBuffer); api.AllocateCommandBuffers(device, in allocateInfo, out CommandBuffer);
Dependants = new List<IAuto>(); Dependants = new List<IAuto>();
Waitables = new List<MultiFenceHolder>(); Waitables = new List<MultiFenceHolder>();
@ -83,7 +83,7 @@ namespace Ryujinx.Graphics.Vulkan
CommandPoolCreateFlags.ResetCommandBufferBit, CommandPoolCreateFlags.ResetCommandBufferBit,
}; };
api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError(); api.CreateCommandPool(device, in commandPoolCreateInfo, null, out _pool).ThrowOnError();
// We need at least 2 command buffers to get texture data in some cases. // We need at least 2 command buffers to get texture data in some cases.
_totalCommandBuffers = isLight ? 2 : MaxCommandBuffers; _totalCommandBuffers = isLight ? 2 : MaxCommandBuffers;
@ -253,7 +253,7 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.CommandBufferBeginInfo, SType = StructureType.CommandBufferBeginInfo,
}; };
_api.BeginCommandBuffer(entry.CommandBuffer, commandBufferBeginInfo).ThrowOnError(); _api.BeginCommandBuffer(entry.CommandBuffer, in commandBufferBeginInfo).ThrowOnError();
return new CommandBufferScoped(this, entry.CommandBuffer, cursor); return new CommandBufferScoped(this, entry.CommandBuffer, cursor);
} }
@ -311,7 +311,7 @@ namespace Ryujinx.Graphics.Vulkan
lock (_queueLock) lock (_queueLock)
{ {
_api.QueueSubmit(_queue, 1, sInfo, entry.Fence.GetUnsafe()).ThrowOnError(); _api.QueueSubmit(_queue, 1, in sInfo, entry.Fence.GetUnsafe()).ThrowOnError();
} }
} }
} }

View file

@ -43,7 +43,7 @@ namespace Ryujinx.Graphics.Vulkan
PBufferInfo = &bufferInfo, PBufferInfo = &bufferInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
} }
@ -66,7 +66,7 @@ namespace Ryujinx.Graphics.Vulkan
PBufferInfo = pBufferInfo, PBufferInfo = pBufferInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
} }
@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Vulkan
PImageInfo = &imageInfo, PImageInfo = &imageInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
} }
@ -107,7 +107,7 @@ namespace Ryujinx.Graphics.Vulkan
PImageInfo = pImageInfo, PImageInfo = pImageInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
} }
@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Vulkan
PImageInfo = pImageInfo, PImageInfo = pImageInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
i += count - 1; i += count - 1;
} }
@ -166,7 +166,7 @@ namespace Ryujinx.Graphics.Vulkan
PTexelBufferView = &texelBufferView, PTexelBufferView = &texelBufferView,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
} }
@ -200,7 +200,7 @@ namespace Ryujinx.Graphics.Vulkan
PTexelBufferView = pTexelBufferView + i, PTexelBufferView = pTexelBufferView + i,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
} }
i += count; i += count;

View file

@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Vulkan
PPoolSizes = pPoolsSize, PPoolSizes = pPoolsSize,
}; };
Api.CreateDescriptorPool(device, descriptorPoolCreateInfo, null, out _pool).ThrowOnError(); Api.CreateDescriptorPool(device, in descriptorPoolCreateInfo, null, out _pool).ThrowOnError();
} }
} }

View file

@ -250,7 +250,7 @@ namespace Ryujinx.Graphics.Vulkan
Layers = Layers, Layers = Layers,
}; };
api.CreateFramebuffer(_device, framebufferCreateInfo, null, out var framebuffer).ThrowOnError(); api.CreateFramebuffer(_device, in framebufferCreateInfo, null, out var framebuffer).ThrowOnError();
return new Auto<DisposableFramebuffer>(new DisposableFramebuffer(api, _device, framebuffer), null, _attachments); return new Auto<DisposableFramebuffer>(new DisposableFramebuffer(api, _device, framebuffer), null, _attachments);
} }

View file

@ -115,7 +115,7 @@ namespace Ryujinx.Graphics.Vulkan
PNext = &importInfo, PNext = &importInfo,
}; };
Result result = _api.AllocateMemory(_device, memoryAllocateInfo, null, out var deviceMemory); Result result = _api.AllocateMemory(_device, in memoryAllocateInfo, null, out var deviceMemory);
if (result < Result.Success) if (result < Result.Success)
{ {

View file

@ -220,7 +220,7 @@ namespace Ryujinx.Graphics.Vulkan
MemoryTypeIndex = (uint)MemoryTypeIndex, MemoryTypeIndex = (uint)MemoryTypeIndex,
}; };
_api.AllocateMemory(_device, memoryAllocateInfo, null, out var deviceMemory).ThrowOnError(); _api.AllocateMemory(_device, in memoryAllocateInfo, null, out var deviceMemory).ThrowOnError();
IntPtr hostPointer = IntPtr.Zero; IntPtr hostPointer = IntPtr.Zero;

View file

@ -102,7 +102,7 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.PipelineCacheCreateInfo, SType = StructureType.PipelineCacheCreateInfo,
}; };
gd.Api.CreatePipelineCache(device, pipelineCacheCreateInfo, null, out PipelineCache).ThrowOnError(); gd.Api.CreatePipelineCache(device, in pipelineCacheCreateInfo, null, out PipelineCache).ThrowOnError();
_descriptorSetUpdater = new DescriptorSetUpdater(gd, device); _descriptorSetUpdater = new DescriptorSetUpdater(gd, device);
_vertexBufferUpdater = new VertexBufferUpdater(gd); _vertexBufferUpdater = new VertexBufferUpdater(gd);
@ -1628,7 +1628,7 @@ namespace Ryujinx.Graphics.Vulkan
ClearValueCount = 1, ClearValueCount = 1,
}; };
Gd.Api.CmdBeginRenderPass(CommandBuffer, renderPassBeginInfo, SubpassContents.Inline); Gd.Api.CmdBeginRenderPass(CommandBuffer, in renderPassBeginInfo, SubpassContents.Inline);
RenderPassActive = true; RenderPassActive = true;
} }
} }

View file

@ -116,7 +116,7 @@ namespace Ryujinx.Graphics.Vulkan
DependencyCount = 1, DependencyCount = 1,
}; };
gd.Api.CreateRenderPass(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); gd.Api.CreateRenderPass(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
return new DisposableRenderPass(gd.Api, device, renderPass); return new DisposableRenderPass(gd.Api, device, renderPass);
} }

View file

@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.Vulkan
Flags = flags, Flags = flags,
}; };
gd.Api.CreateDescriptorSetLayout(device, descriptorSetLayoutCreateInfo, null, out layouts[setIndex]).ThrowOnError(); gd.Api.CreateDescriptorSetLayout(device, in descriptorSetLayoutCreateInfo, null, out layouts[setIndex]).ThrowOnError();
} }
} }

View file

@ -52,7 +52,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
PipelineStatistics = flags, PipelineStatistics = flags,
}; };
gd.Api.CreateQueryPool(device, queryPoolCreateInfo, null, out _queryPool).ThrowOnError(); gd.Api.CreateQueryPool(device, in queryPoolCreateInfo, null, out _queryPool).ThrowOnError();
} }
var buffer = gd.BufferManager.Create(gd, sizeof(long), forConditionalRendering: true); var buffer = gd.BufferManager.Create(gd, sizeof(long), forConditionalRendering: true);

View file

@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
DependencyCount = 1, DependencyCount = 1,
}; };
gd.Api.CreateRenderPass(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); gd.Api.CreateRenderPass(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
_renderPass = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass)); _renderPass = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass));
} }

View file

@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Vulkan
samplerCreateInfo.BorderColor = BorderColor.FloatCustomExt; samplerCreateInfo.BorderColor = BorderColor.FloatCustomExt;
} }
gd.Api.CreateSampler(device, samplerCreateInfo, null, out var sampler).ThrowOnError(); gd.Api.CreateSampler(device, in samplerCreateInfo, null, out var sampler).ThrowOnError();
_sampler = new Auto<DisposableSampler>(new DisposableSampler(gd.Api, device, sampler)); _sampler = new Auto<DisposableSampler>(new DisposableSampler(gd.Api, device, sampler));
} }

View file

@ -64,7 +64,7 @@ namespace Ryujinx.Graphics.Vulkan
PCode = (uint*)pCode, PCode = (uint*)pCode,
}; };
api.CreateShaderModule(device, shaderModuleCreateInfo, null, out _module).ThrowOnError(); api.CreateShaderModule(device, in shaderModuleCreateInfo, null, out _module).ThrowOnError();
} }
CompileStatus = ProgramLinkStatus.Success; CompileStatus = ProgramLinkStatus.Success;

View file

@ -88,7 +88,7 @@ namespace Ryujinx.Graphics.Vulkan
DstOffsets = dstOffsets, DstOffsets = dstOffsets,
}; };
api.CmdBlitImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region, filter); api.CmdBlitImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region, filter);
copySrcLevel++; copySrcLevel++;
copyDstLevel++; copyDstLevel++;
@ -320,13 +320,13 @@ namespace Ryujinx.Graphics.Vulkan
{ {
var region = new ImageResolve(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent); var region = new ImageResolve(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
api.CmdResolveImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region); api.CmdResolveImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region);
} }
else else
{ {
var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent); var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region); api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region);
} }
width = Math.Max(1, width >> 1); width = Math.Max(1, width >> 1);
@ -422,7 +422,7 @@ namespace Ryujinx.Graphics.Vulkan
DependencyCount = 1, DependencyCount = 1,
}; };
gd.Api.CreateRenderPass2(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); gd.Api.CreateRenderPass2(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
using var rp = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass)); using var rp = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass));
@ -445,7 +445,7 @@ namespace Ryujinx.Graphics.Vulkan
Layers = (uint)src.Layers, Layers = (uint)src.Layers,
}; };
gd.Api.CreateFramebuffer(device, framebufferCreateInfo, null, out var framebuffer).ThrowOnError(); gd.Api.CreateFramebuffer(device, in framebufferCreateInfo, null, out var framebuffer).ThrowOnError();
using var fb = new Auto<DisposableFramebuffer>(new DisposableFramebuffer(gd.Api, device, framebuffer), null, srcView, dstView); using var fb = new Auto<DisposableFramebuffer>(new DisposableFramebuffer(gd.Api, device, framebuffer), null, srcView, dstView);
var renderArea = new Rect2D(null, new Extent2D((uint)src.Info.Width, (uint)src.Info.Height)); var renderArea = new Rect2D(null, new Extent2D((uint)src.Info.Width, (uint)src.Info.Height));
@ -465,7 +465,7 @@ namespace Ryujinx.Graphics.Vulkan
// to resolve the depth-stencil texture. // to resolve the depth-stencil texture.
// TODO: Do speculative resolve and part of the same render pass as the draw to avoid // TODO: Do speculative resolve and part of the same render pass as the draw to avoid
// ending the current render pass? // ending the current render pass?
gd.Api.CmdBeginRenderPass(cbs.CommandBuffer, renderPassBeginInfo, SubpassContents.Inline); gd.Api.CmdBeginRenderPass(cbs.CommandBuffer, in renderPassBeginInfo, SubpassContents.Inline);
gd.Api.CmdEndRenderPass(cbs.CommandBuffer); gd.Api.CmdEndRenderPass(cbs.CommandBuffer);
} }
} }

View file

@ -114,7 +114,7 @@ namespace Ryujinx.Graphics.Vulkan
Flags = flags, Flags = flags,
}; };
gd.Api.CreateImage(device, imageCreateInfo, null, out _image).ThrowOnError(); gd.Api.CreateImage(device, in imageCreateInfo, null, out _image).ThrowOnError();
if (foreignAllocation == null) if (foreignAllocation == null)
{ {
@ -284,7 +284,7 @@ namespace Ryujinx.Graphics.Vulkan
0, 0,
null, null,
1, 1,
barrier); in barrier);
if (useTempCbs) if (useTempCbs)
{ {
@ -401,11 +401,11 @@ namespace Ryujinx.Graphics.Vulkan
if (to) if (to)
{ {
_gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
} }
else else
{ {
_gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
} }
offset += mipSize; offset += mipSize;

View file

@ -117,7 +117,7 @@ namespace Ryujinx.Graphics.Vulkan
PNext = &imageViewUsage, PNext = &imageViewUsage,
}; };
gd.Api.CreateImageView(device, imageCreateInfo, null, out var imageView).ThrowOnError(); gd.Api.CreateImageView(device, in imageCreateInfo, null, out var imageView).ThrowOnError();
return new Auto<DisposableImageView>(new DisposableImageView(gd.Api, device, imageView), null, storage.GetImage()); return new Auto<DisposableImageView>(new DisposableImageView(gd.Api, device, imageView), null, storage.GetImage());
} }
@ -492,7 +492,7 @@ namespace Ryujinx.Graphics.Vulkan
dstStageMask, dstStageMask,
DependencyFlags.None, DependencyFlags.None,
1, 1,
memoryBarrier, in memoryBarrier,
0, 0,
null, null,
0, 0,
@ -557,7 +557,7 @@ namespace Ryujinx.Graphics.Vulkan
0, 0,
null, null,
1, 1,
memoryBarrier); in memoryBarrier);
} }
public TextureView GetView(Format format) public TextureView GetView(Format format)
@ -949,11 +949,11 @@ namespace Ryujinx.Graphics.Vulkan
if (to) if (to)
{ {
_gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
} }
else else
{ {
_gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
} }
offset += mipSize; offset += mipSize;
@ -1010,11 +1010,11 @@ namespace Ryujinx.Graphics.Vulkan
if (to) if (to)
{ {
_gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
} }
else else
{ {
_gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
} }
} }

View file

@ -160,7 +160,7 @@ namespace Ryujinx.Graphics.Vulkan
SwizzleComponent.Blue, SwizzleComponent.Blue,
SwizzleComponent.Alpha); SwizzleComponent.Alpha);
_gd.SwapchainApi.CreateSwapchain(_device, swapchainCreateInfo, null, out _swapchain).ThrowOnError(); _gd.SwapchainApi.CreateSwapchain(_device, in swapchainCreateInfo, null, out _swapchain).ThrowOnError();
_gd.SwapchainApi.GetSwapchainImages(_device, _swapchain, &imageCount, null); _gd.SwapchainApi.GetSwapchainImages(_device, _swapchain, &imageCount, null);
@ -187,14 +187,14 @@ namespace Ryujinx.Graphics.Vulkan
for (int i = 0; i < _imageAvailableSemaphores.Length; i++) for (int i = 0; i < _imageAvailableSemaphores.Length; i++)
{ {
_gd.Api.CreateSemaphore(_device, semaphoreCreateInfo, null, out _imageAvailableSemaphores[i]).ThrowOnError(); _gd.Api.CreateSemaphore(_device, in semaphoreCreateInfo, null, out _imageAvailableSemaphores[i]).ThrowOnError();
} }
_renderFinishedSemaphores = new Semaphore[imageCount]; _renderFinishedSemaphores = new Semaphore[imageCount];
for (int i = 0; i < _renderFinishedSemaphores.Length; i++) for (int i = 0; i < _renderFinishedSemaphores.Length; i++)
{ {
_gd.Api.CreateSemaphore(_device, semaphoreCreateInfo, null, out _renderFinishedSemaphores[i]).ThrowOnError(); _gd.Api.CreateSemaphore(_device, in semaphoreCreateInfo, null, out _renderFinishedSemaphores[i]).ThrowOnError();
} }
} }
@ -220,7 +220,7 @@ namespace Ryujinx.Graphics.Vulkan
SubresourceRange = subresourceRange, SubresourceRange = subresourceRange,
}; };
_gd.Api.CreateImageView(_device, imageCreateInfo, null, out var imageView).ThrowOnError(); _gd.Api.CreateImageView(_device, in imageCreateInfo, null, out var imageView).ThrowOnError();
return new TextureView(_gd, _device, new DisposableImageView(_gd.Api, _device, imageView), info, format); return new TextureView(_gd, _device, new DisposableImageView(_gd.Api, _device, imageView), info, format);
} }
@ -479,7 +479,7 @@ namespace Ryujinx.Graphics.Vulkan
lock (_gd.QueueLock) lock (_gd.QueueLock)
{ {
_gd.SwapchainApi.QueuePresent(_gd.Queue, presentInfo); _gd.SwapchainApi.QueuePresent(_gd.Queue, in presentInfo);
} }
} }
@ -611,7 +611,7 @@ namespace Ryujinx.Graphics.Vulkan
0, 0,
null, null,
1, 1,
barrier); in barrier);
} }
private void CaptureFrame(TextureView texture, int x, int y, int width, int height, bool isBgra, bool flipX, bool flipY) private void CaptureFrame(TextureView texture, int x, int y, int width, int height, bool isBgra, bool flipX, bool flipY)

View file

@ -20,7 +20,7 @@ using System.IO;
using System.Reflection; using System.Reflection;
using Image = SixLabors.ImageSharp.Image; using Image = SixLabors.ImageSharp.Image;
namespace Ryujinx.UI.Windows namespace Ryujinx.Gtk3.UI.Windows
{ {
public class AvatarWindow : Window public class AvatarWindow : Window
{ {
@ -170,7 +170,7 @@ namespace Ryujinx.UI.Windows
{ {
using MemoryStream streamJpg = MemoryStreamManager.Shared.GetStream(); using MemoryStream streamJpg = MemoryStreamManager.Shared.GetStream();
Image avatarImage = Image.Load(data, new PngDecoder()); Image avatarImage = Image.Load(data);
avatarImage.Mutate(x => x.BackgroundColor(new Rgba32( avatarImage.Mutate(x => x.BackgroundColor(new Rgba32(
(byte)(_backgroundColor.Red * 255), (byte)(_backgroundColor.Red * 255),
@ -265,7 +265,7 @@ namespace Ryujinx.UI.Windows
byte byte1 = input[inputOffset++]; byte byte1 = input[inputOffset++];
byte byte2 = input[inputOffset++]; byte byte2 = input[inputOffset++];
int dist = ((byte1 & 0xF) << 8) | byte2; int dist = (byte1 & 0xF) << 8 | byte2;
int position = (int)outputOffset - (dist + 1); int position = (int)outputOffset - (dist + 1);
int length = byte1 >> 4; int length = byte1 >> 4;

View file

@ -1,5 +1,6 @@
using Gtk; using Gtk;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using Ryujinx.Gtk3.UI.Windows;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Configuration;

View file

@ -56,8 +56,8 @@ namespace Ryujinx.Tests.Memory
handle.QueryModified(startAddress, size, (address, range) => handle.QueryModified(startAddress, size, (address, range) =>
{ {
Assert.IsTrue(addressPredicate(address)); // Written pages must be even. Assert.That(addressPredicate(address), Is.True); // Written pages must be even.
Assert.GreaterOrEqual(address, lastAddress); // Must be signalled in ascending order, regardless of write order. Assert.That(address, Is.GreaterThanOrEqualTo(lastAddress)); // Must be signalled in ascending order, regardless of write order.
lastAddress = address; lastAddress = address;
regionCount++; regionCount++;
}); });
@ -72,8 +72,8 @@ namespace Ryujinx.Tests.Memory
handle.QueryModified(startAddress, size, (address, range) => handle.QueryModified(startAddress, size, (address, range) =>
{ {
Assert.IsTrue(addressPredicate(address)); // Written pages must be even. Assert.That(addressPredicate(address), Is.True); // Written pages must be even.
Assert.GreaterOrEqual(address, lastAddress); // Must be signalled in ascending order, regardless of write order. Assert.That(address, Is.GreaterThanOrEqualTo(lastAddress)); // Must be signalled in ascending order, regardless of write order.
lastAddress = address; lastAddress = address;
regionCount++; regionCount++;
}, sequenceNumber); }, sequenceNumber);
@ -93,7 +93,7 @@ namespace Ryujinx.Tests.Memory
{ {
resultAddress = address; resultAddress = address;
}); });
Assert.AreEqual(resultAddress, (ulong)i * PageSize + address); Assert.That(resultAddress, Is.EqualTo((ulong)i * PageSize + address));
}); });
} }
@ -119,7 +119,7 @@ namespace Ryujinx.Tests.Memory
int oddRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 1); int oddRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 1);
Assert.AreEqual(oddRegionCount, PageCount / 2); // Must have written to all odd pages. Assert.That(oddRegionCount, Is.EqualTo(PageCount / 2)); // Must have written to all odd pages.
// Write to all the even pages. // Write to all the even pages.
RandomOrder(random, even, (i) => RandomOrder(random, even, (i) =>
@ -129,7 +129,7 @@ namespace Ryujinx.Tests.Memory
int evenRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 0); int evenRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 0);
Assert.AreEqual(evenRegionCount, PageCount / 2); Assert.That(evenRegionCount, Is.EqualTo(PageCount / 2));
} }
[Test] [Test]
@ -172,7 +172,7 @@ namespace Ryujinx.Tests.Memory
}, 1); }, 1);
} }
Assert.AreEqual(oddRegionCount, PageCount / 2); // Must have written to all odd pages. Assert.That(oddRegionCount, Is.EqualTo(PageCount / 2)); // Must have written to all odd pages.
// Write to all pages. // Write to all pages.
@ -182,19 +182,19 @@ namespace Ryujinx.Tests.Memory
int evenRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 0, 1); int evenRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 0, 1);
Assert.AreEqual(evenRegionCount, PageCount / 2); // Must have written to all even pages. Assert.That(evenRegionCount, Is.EqualTo(PageCount / 2)); // Must have written to all even pages.
oddRegionCount = 0; oddRegionCount = 0;
handle.QueryModified(0, PageSize * PageCount, (address, range) => { oddRegionCount++; }, 1); handle.QueryModified(0, PageSize * PageCount, (address, range) => { oddRegionCount++; }, 1);
Assert.AreEqual(oddRegionCount, 0); // Sequence number has not changed, so found no dirty subregions. Assert.That(oddRegionCount, Is.EqualTo(0)); // Sequence number has not changed, so found no dirty subregions.
// With sequence number 2, all all pages should be reported as modified. // With sequence number 2, all all pages should be reported as modified.
oddRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 1, 2); oddRegionCount = ExpectQueryInOrder(handle, 0, PageSize * PageCount, (address) => (address / PageSize) % 2 == 1, 2);
Assert.AreEqual(oddRegionCount, PageCount / 2); // Must have written to all odd pages. Assert.That(oddRegionCount, Is.EqualTo(PageCount / 2)); // Must have written to all odd pages.
} }
[Test] [Test]
@ -242,8 +242,8 @@ namespace Ryujinx.Tests.Memory
{ {
int region = regionSizes[regionInd++]; int region = regionSizes[regionInd++];
Assert.AreEqual(address, expectedAddress); Assert.That(address, Is.EqualTo(expectedAddress));
Assert.AreEqual(size, (ulong)(PageSize * region)); Assert.That(size, Is.EqualTo((ulong)(PageSize * region)));
expectedAddress += (ulong)(PageSize * (region + 1)); expectedAddress += (ulong)(PageSize * (region + 1));
}); });
@ -256,12 +256,12 @@ namespace Ryujinx.Tests.Memory
const int PageCount = 32; const int PageCount = 32;
const int OverlapStart = 16; const int OverlapStart = 16;
Assert.AreEqual(0, _tracking.GetRegionCount()); Assert.That(0, Is.EqualTo(_tracking.GetRegionCount()));
IMultiRegionHandle handleLow = GetGranular(smart, 0, PageSize * PageCount, PageSize); IMultiRegionHandle handleLow = GetGranular(smart, 0, PageSize * PageCount, PageSize);
PreparePages(handleLow, PageCount); PreparePages(handleLow, PageCount);
Assert.AreEqual(PageCount, _tracking.GetRegionCount()); Assert.That(PageCount, Is.EqualTo(_tracking.GetRegionCount()));
IMultiRegionHandle handleHigh = GetGranular(smart, PageSize * OverlapStart, PageSize * PageCount, PageSize); IMultiRegionHandle handleHigh = GetGranular(smart, PageSize * OverlapStart, PageSize * PageCount, PageSize);
PreparePages(handleHigh, PageCount, PageSize * OverlapStart); PreparePages(handleHigh, PageCount, PageSize * OverlapStart);
@ -269,15 +269,15 @@ namespace Ryujinx.Tests.Memory
// Combined pages (and assuming overlapStart <= pageCount) should be pageCount after overlapStart. // Combined pages (and assuming overlapStart <= pageCount) should be pageCount after overlapStart.
int totalPages = OverlapStart + PageCount; int totalPages = OverlapStart + PageCount;
Assert.AreEqual(totalPages, _tracking.GetRegionCount()); Assert.That(totalPages, Is.EqualTo(_tracking.GetRegionCount()));
handleLow.Dispose(); // After disposing one, the pages for the other remain. handleLow.Dispose(); // After disposing one, the pages for the other remain.
Assert.AreEqual(PageCount, _tracking.GetRegionCount()); Assert.That(PageCount, Is.EqualTo(_tracking.GetRegionCount()));
handleHigh.Dispose(); // After disposing the other, there are no pages left. handleHigh.Dispose(); // After disposing the other, there are no pages left.
Assert.AreEqual(0, _tracking.GetRegionCount()); Assert.That(0, Is.EqualTo(_tracking.GetRegionCount()));
} }
[Test] [Test]
@ -357,19 +357,19 @@ namespace Ryujinx.Tests.Memory
bool modified = false; bool modified = false;
combined.QueryModified(PageSize * (ulong)i, PageSize, (_, _) => { modified = true; }); combined.QueryModified(PageSize * (ulong)i, PageSize, (_, _) => { modified = true; });
Assert.AreEqual(expectedDirty[i], modified); Assert.That(expectedDirty[i], Is.EqualTo(modified));
} }
Assert.AreEqual(new bool[3], actionsTriggered); Assert.That(new bool[3], Is.EqualTo(actionsTriggered));
_tracking.VirtualMemoryEvent(PageSize * 5, PageSize, false); _tracking.VirtualMemoryEvent(PageSize * 5, PageSize, false);
Assert.IsTrue(actionsTriggered[0]); Assert.That(actionsTriggered[0], Is.True);
_tracking.VirtualMemoryEvent(PageSize * 10, PageSize, false); _tracking.VirtualMemoryEvent(PageSize * 10, PageSize, false);
Assert.IsTrue(actionsTriggered[1]); Assert.That(actionsTriggered[1], Is.True);
_tracking.VirtualMemoryEvent(PageSize * 15, PageSize, false); _tracking.VirtualMemoryEvent(PageSize * 15, PageSize, false);
Assert.IsTrue(actionsTriggered[2]); Assert.That(actionsTriggered[2], Is.True);
// The double page handles should be disposed, as they were split into granular handles. // The double page handles should be disposed, as they were split into granular handles.
foreach (RegionHandle doublePage in doublePages) foreach (RegionHandle doublePage in doublePages)
@ -386,18 +386,18 @@ namespace Ryujinx.Tests.Memory
throws = true; throws = true;
} }
Assert.IsTrue(throws); Assert.That(throws, Is.True);
} }
IEnumerable<IRegionHandle> combinedHandles = combined.GetHandles(); IEnumerable<IRegionHandle> combinedHandles = combined.GetHandles();
Assert.AreEqual(handleGroups[0].ElementAt(0), combinedHandles.ElementAt(3)); Assert.That(handleGroups[0].ElementAt(0), Is.EqualTo(combinedHandles.ElementAt(3)));
Assert.AreEqual(handleGroups[0].ElementAt(1), combinedHandles.ElementAt(4)); Assert.That(handleGroups[0].ElementAt(1), Is.EqualTo(combinedHandles.ElementAt(4)));
Assert.AreEqual(handleGroups[0].ElementAt(2), combinedHandles.ElementAt(5)); Assert.That(handleGroups[0].ElementAt(2), Is.EqualTo(combinedHandles.ElementAt(5)));
Assert.AreEqual(singlePages[0], combinedHandles.ElementAt(8)); Assert.That(singlePages[0], Is.EqualTo(combinedHandles.ElementAt(8)));
Assert.AreEqual(singlePages[1], combinedHandles.ElementAt(9)); Assert.That(singlePages[1], Is.EqualTo(combinedHandles.ElementAt(9)));
Assert.AreEqual(singlePages[2], combinedHandles.ElementAt(10)); Assert.That(singlePages[2], Is.EqualTo(combinedHandles.ElementAt(10)));
} }
[Test] [Test]
@ -413,11 +413,11 @@ namespace Ryujinx.Tests.Memory
// Precise write to first handle in the multiregion. // Precise write to first handle in the multiregion.
_tracking.VirtualMemoryEvent(PageSize * 3, PageSize, true, precise: true); _tracking.VirtualMemoryEvent(PageSize * 3, PageSize, true, precise: true);
Assert.IsFalse(actionTriggered); // Action not triggered. Assert.That(actionTriggered, Is.False); // Action not triggered.
bool firstPageModified = false; bool firstPageModified = false;
granular.QueryModified(PageSize * 3, PageSize, (_, _) => { firstPageModified = true; }); granular.QueryModified(PageSize * 3, PageSize, (_, _) => { firstPageModified = true; });
Assert.IsTrue(firstPageModified); // First page is modified. Assert.That(firstPageModified, Is.True); // First page is modified.
// Precise write to all handles in the multiregion. // Precise write to all handles in the multiregion.
_tracking.VirtualMemoryEvent(PageSize * 3, PageSize * 3, true, precise: true); _tracking.VirtualMemoryEvent(PageSize * 3, PageSize * 3, true, precise: true);
@ -430,10 +430,10 @@ namespace Ryujinx.Tests.Memory
granular.QueryModified(PageSize * (ulong)i, PageSize, (_, _) => { pagesModified[index] = true; }); granular.QueryModified(PageSize * (ulong)i, PageSize, (_, _) => { pagesModified[index] = true; });
} }
Assert.IsTrue(actionTriggered); // Action triggered. Assert.That(actionTriggered, Is.True); // Action triggered.
// Precise writes are ignored on two later handles due to the action returning true. // Precise writes are ignored on two later handles due to the action returning true.
Assert.AreEqual(pagesModified, new bool[] { true, false, false }); Assert.That(pagesModified, Is.EqualTo(new bool[] { true, false, false }));
} }
} }
} }

View file

@ -28,7 +28,7 @@ namespace Ryujinx.Tests.Memory
{ {
Marshal.WriteInt32(_memoryBlock.Pointer, 0x2020, 0x1234abcd); Marshal.WriteInt32(_memoryBlock.Pointer, 0x2020, 0x1234abcd);
Assert.AreEqual(_memoryBlock.Read<int>(0x2020), 0x1234abcd); Assert.That(_memoryBlock.Read<int>(0x2020), Is.EqualTo(0x1234abcd));
} }
[Test] [Test]
@ -36,7 +36,7 @@ namespace Ryujinx.Tests.Memory
{ {
_memoryBlock.Write(0x2040, 0xbadc0de); _memoryBlock.Write(0x2040, 0xbadc0de);
Assert.AreEqual(Marshal.ReadInt32(_memoryBlock.Pointer, 0x2040), 0xbadc0de); Assert.That(Marshal.ReadInt32(_memoryBlock.Pointer, 0x2040), Is.EqualTo(0xbadc0de));
} }
[Test] [Test]
@ -54,7 +54,7 @@ namespace Ryujinx.Tests.Memory
toAlias.UnmapView(backing, pageSize * 3, pageSize); toAlias.UnmapView(backing, pageSize * 3, pageSize);
toAlias.Write(0, 0xbadc0de); toAlias.Write(0, 0xbadc0de);
Assert.AreEqual(Marshal.ReadInt32(backing.Pointer, (int)pageSize), 0xbadc0de); Assert.That(Marshal.ReadInt32(backing.Pointer, (int)pageSize), Is.EqualTo(0xbadc0de));
} }
[Test] [Test]
@ -84,7 +84,7 @@ namespace Ryujinx.Tests.Memory
int offset = rng.Next(0, (int)pageSize - sizeof(int)); int offset = rng.Next(0, (int)pageSize - sizeof(int));
toAlias.Write((ulong)((dstPage << pageBits) + offset), 0xbadc0de); toAlias.Write((ulong)((dstPage << pageBits) + offset), 0xbadc0de);
Assert.AreEqual(Marshal.ReadInt32(backing.Pointer, (srcPage << pageBits) + offset), 0xbadc0de); Assert.That(Marshal.ReadInt32(backing.Pointer, (srcPage << pageBits) + offset), Is.EqualTo(0xbadc0de));
} }
else else
{ {
@ -109,7 +109,7 @@ namespace Ryujinx.Tests.Memory
toAlias.MapView(backing, 0, offset, pageSize); toAlias.MapView(backing, 0, offset, pageSize);
toAlias.Write(offset, 0xbadc0de); toAlias.Write(offset, 0xbadc0de);
Assert.AreEqual(0xbadc0de, backing.Read<int>(0)); Assert.That(0xbadc0de, Is.EqualTo(backing.Read<int>(0)));
toAlias.UnmapView(backing, offset, pageSize); toAlias.UnmapView(backing, offset, pageSize);
} }

View file

@ -53,46 +53,46 @@ namespace Ryujinx.Tests.Memory
}); });
bool dirtyInitial = handle.Dirty; bool dirtyInitial = handle.Dirty;
Assert.True(dirtyInitial); // Handle starts dirty. Assert.That(dirtyInitial, Is.True); // Handle starts dirty.
handle.Reprotect(); handle.Reprotect();
bool dirtyAfterReprotect = handle.Dirty; bool dirtyAfterReprotect = handle.Dirty;
Assert.False(dirtyAfterReprotect); // Handle is no longer dirty. Assert.That(dirtyAfterReprotect, Is.False); // Handle is no longer dirty.
_tracking.VirtualMemoryEvent(PageSize * 2, 4, true); _tracking.VirtualMemoryEvent(PageSize * 2, 4, true);
_tracking.VirtualMemoryEvent(PageSize * 2, 4, false); _tracking.VirtualMemoryEvent(PageSize * 2, 4, false);
bool dirtyAfterUnrelatedReadWrite = handle.Dirty; bool dirtyAfterUnrelatedReadWrite = handle.Dirty;
Assert.False(dirtyAfterUnrelatedReadWrite); // Not dirtied, as the write was to an unrelated address. Assert.That(dirtyAfterUnrelatedReadWrite, Is.False); // Not dirtied, as the write was to an unrelated address.
Assert.IsNull(readTrackingTriggered); // Hasn't been triggered yet Assert.That(readTrackingTriggered, Is.Null); // Hasn't been triggered yet
_tracking.VirtualMemoryEvent(0, 4, false); _tracking.VirtualMemoryEvent(0, 4, false);
bool dirtyAfterRelatedRead = handle.Dirty; bool dirtyAfterRelatedRead = handle.Dirty;
Assert.False(dirtyAfterRelatedRead); // Only triggers on write. Assert.That(dirtyAfterRelatedRead, Is.False); // Only triggers on write.
Assert.AreEqual(readTrackingTriggered, (0UL, 4UL)); // Read action was triggered. Assert.That(readTrackingTriggered, Is.EqualTo((0UL, 4UL))); // Read action was triggered.
readTrackingTriggered = null; readTrackingTriggered = null;
_tracking.VirtualMemoryEvent(0, 4, true); _tracking.VirtualMemoryEvent(0, 4, true);
bool dirtyAfterRelatedWrite = handle.Dirty; bool dirtyAfterRelatedWrite = handle.Dirty;
Assert.True(dirtyAfterRelatedWrite); // Dirty flag should now be set. Assert.That(dirtyAfterRelatedWrite, Is.True); // Dirty flag should now be set.
_tracking.VirtualMemoryEvent(4, 4, true); _tracking.VirtualMemoryEvent(4, 4, true);
bool dirtyAfterRelatedWrite2 = handle.Dirty; bool dirtyAfterRelatedWrite2 = handle.Dirty;
Assert.True(dirtyAfterRelatedWrite2); // Dirty flag should still be set. Assert.That(dirtyAfterRelatedWrite2, Is.True); // Dirty flag should still be set.
handle.Reprotect(); handle.Reprotect();
bool dirtyAfterReprotect2 = handle.Dirty; bool dirtyAfterReprotect2 = handle.Dirty;
Assert.False(dirtyAfterReprotect2); // Handle is no longer dirty. Assert.That(dirtyAfterReprotect2, Is.False); // Handle is no longer dirty.
handle.Dispose(); handle.Dispose();
bool dirtyAfterDispose = TestSingleWrite(handle, 0, 4); bool dirtyAfterDispose = TestSingleWrite(handle, 0, 4);
Assert.False(dirtyAfterDispose); // Handle cannot be triggered when disposed Assert.That(dirtyAfterDispose, Is.False); // Handle cannot be triggered when disposed
} }
[Test] [Test]
@ -126,27 +126,27 @@ namespace Ryujinx.Tests.Memory
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
// No handles are dirty. // No handles are dirty.
Assert.False(allHandle.Dirty); Assert.That(allHandle.Dirty, Is.False);
Assert.IsNull(readTrackingTriggeredAll); Assert.That(readTrackingTriggeredAll, Is.Null);
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
{ {
Assert.False(containedHandles[j].Dirty); Assert.That(containedHandles[j].Dirty, Is.False);
} }
_tracking.VirtualMemoryEvent((ulong)i * PageSize, 1, true); _tracking.VirtualMemoryEvent((ulong)i * PageSize, 1, true);
// Only the handle covering the entire range and the relevant contained handle are dirty. // Only the handle covering the entire range and the relevant contained handle are dirty.
Assert.True(allHandle.Dirty); Assert.That(allHandle.Dirty, Is.True);
Assert.AreEqual(readTrackingTriggeredAll, ((ulong)i * PageSize, 1UL)); // Triggered read tracking Assert.That(readTrackingTriggeredAll, Is.EqualTo(((ulong)i * PageSize, 1UL))); // Triggered read tracking
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
{ {
if (j == i) if (j == i)
{ {
Assert.True(containedHandles[j].Dirty); Assert.That(containedHandles[j].Dirty, Is.True);
} }
else else
{ {
Assert.False(containedHandles[j].Dirty); Assert.That(containedHandles[j].Dirty, Is.False);
} }
} }
@ -171,27 +171,27 @@ namespace Ryujinx.Tests.Memory
// Anywhere inside the pages the region is contained on should trigger. // Anywhere inside the pages the region is contained on should trigger.
bool originalRangeTriggers = TestSingleWrite(handle, address, size); bool originalRangeTriggers = TestSingleWrite(handle, address, size);
Assert.True(originalRangeTriggers); Assert.That(originalRangeTriggers, Is.True);
bool alignedRangeTriggers = TestSingleWrite(handle, alignedStart, alignedSize); bool alignedRangeTriggers = TestSingleWrite(handle, alignedStart, alignedSize);
Assert.True(alignedRangeTriggers); Assert.That(alignedRangeTriggers, Is.True);
bool alignedStartTriggers = TestSingleWrite(handle, alignedStart, 1); bool alignedStartTriggers = TestSingleWrite(handle, alignedStart, 1);
Assert.True(alignedStartTriggers); Assert.That(alignedStartTriggers, Is.True);
bool alignedEndTriggers = TestSingleWrite(handle, alignedEnd - 1, 1); bool alignedEndTriggers = TestSingleWrite(handle, alignedEnd - 1, 1);
Assert.True(alignedEndTriggers); Assert.That(alignedEndTriggers, Is.True);
// Outside the tracked range should not trigger. // Outside the tracked range should not trigger.
bool alignedBeforeTriggers = TestSingleWrite(handle, alignedStart - 1, 1); bool alignedBeforeTriggers = TestSingleWrite(handle, alignedStart - 1, 1);
Assert.False(alignedBeforeTriggers); Assert.That(alignedBeforeTriggers, Is.False);
bool alignedAfterTriggers = TestSingleWrite(handle, alignedEnd, 1); bool alignedAfterTriggers = TestSingleWrite(handle, alignedEnd, 1);
Assert.False(alignedAfterTriggers); Assert.That(alignedAfterTriggers, Is.False);
} }
[Test, Explicit, Timeout(1000)] [Test, Explicit, CancelAfter(1000)]
public void Multithreading() public void Multithreading()
{ {
// Multithreading sanity test // Multithreading sanity test
@ -287,9 +287,9 @@ namespace Ryujinx.Tests.Memory
thread.Join(); thread.Join();
} }
Assert.Greater(dirtyFlagReprotects, 10); Assert.That(dirtyFlagReprotects, Is.GreaterThan(10));
Assert.Greater(writeTriggers, 10); Assert.That(writeTriggers, Is.GreaterThan(10));
Assert.Greater(handleLifecycles, 10); Assert.That(handleLifecycles, Is.GreaterThan(10));
} }
[Test] [Test]
@ -354,7 +354,7 @@ namespace Ryujinx.Tests.Memory
// The action should trigger exactly once for every registration, // The action should trigger exactly once for every registration,
// then we register once after all the threads signalling it cease. // then we register once after all the threads signalling it cease.
Assert.AreEqual(registeredCount, triggeredCount + 1); Assert.That(registeredCount, Is.EqualTo(triggeredCount + 1));
} }
[Test] [Test]
@ -365,11 +365,11 @@ namespace Ryujinx.Tests.Memory
RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0);
handle.Reprotect(); handle.Reprotect();
Assert.AreEqual(1, _tracking.GetRegionCount()); Assert.That(1, Is.EqualTo(_tracking.GetRegionCount()));
handle.Dispose(); handle.Dispose();
Assert.AreEqual(0, _tracking.GetRegionCount()); Assert.That(0, Is.EqualTo(_tracking.GetRegionCount()));
// Two handles, small entirely contains big. // Two handles, small entirely contains big.
// We expect there to be three regions after creating both, one for the small region and two covering the big one around it. // We expect there to be three regions after creating both, one for the small region and two covering the big one around it.
@ -378,16 +378,16 @@ namespace Ryujinx.Tests.Memory
RegionHandle handleSmall = _tracking.BeginTracking(PageSize, PageSize, 0); RegionHandle handleSmall = _tracking.BeginTracking(PageSize, PageSize, 0);
RegionHandle handleBig = _tracking.BeginTracking(0, PageSize * 4, 0); RegionHandle handleBig = _tracking.BeginTracking(0, PageSize * 4, 0);
Assert.AreEqual(3, _tracking.GetRegionCount()); Assert.That(3, Is.EqualTo(_tracking.GetRegionCount()));
// After disposing the big region, only the small one will remain. // After disposing the big region, only the small one will remain.
handleBig.Dispose(); handleBig.Dispose();
Assert.AreEqual(1, _tracking.GetRegionCount()); Assert.That(1, Is.EqualTo(_tracking.GetRegionCount()));
handleSmall.Dispose(); handleSmall.Dispose();
Assert.AreEqual(0, _tracking.GetRegionCount()); Assert.That(0, Is.EqualTo(_tracking.GetRegionCount()));
} }
[Test] [Test]
@ -397,22 +397,22 @@ namespace Ryujinx.Tests.Memory
_memoryManager.OnProtect += (va, size, newProtection) => _memoryManager.OnProtect += (va, size, newProtection) =>
{ {
Assert.AreEqual((0, PageSize), (va, size)); // Should protect the exact region all the operations use. Assert.That((0, PageSize), Is.EqualTo((va, size))); // Should protect the exact region all the operations use.
protection = newProtection; protection = newProtection;
}; };
RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0);
// After creating the handle, there is no protection yet. // After creating the handle, there is no protection yet.
Assert.AreEqual(MemoryPermission.ReadAndWrite, protection); Assert.That(MemoryPermission.ReadAndWrite, Is.EqualTo(protection));
bool dirtyInitial = handle.Dirty; bool dirtyInitial = handle.Dirty;
Assert.True(dirtyInitial); // Handle starts dirty. Assert.That(dirtyInitial, Is.True); // Handle starts dirty.
handle.Reprotect(); handle.Reprotect();
// After a reprotect, there is write protection, which will set a dirty flag when any write happens. // After a reprotect, there is write protection, which will set a dirty flag when any write happens.
Assert.AreEqual(MemoryPermission.Read, protection); Assert.That(MemoryPermission.Read, Is.EqualTo(protection));
(ulong address, ulong size)? readTrackingTriggered = null; (ulong address, ulong size)? readTrackingTriggered = null;
handle.RegisterAction((address, size) => handle.RegisterAction((address, size) =>
@ -421,21 +421,21 @@ namespace Ryujinx.Tests.Memory
}); });
// Registering an action adds read/write protection. // Registering an action adds read/write protection.
Assert.AreEqual(MemoryPermission.None, protection); Assert.That(MemoryPermission.None, Is.EqualTo(protection));
bool dirtyAfterReprotect = handle.Dirty; bool dirtyAfterReprotect = handle.Dirty;
Assert.False(dirtyAfterReprotect); // Handle is no longer dirty. Assert.That(dirtyAfterReprotect, Is.False); // Handle is no longer dirty.
// First we should read, which will trigger the action. This _should not_ remove write protection on the memory. // First we should read, which will trigger the action. This _should not_ remove write protection on the memory.
_tracking.VirtualMemoryEvent(0, 4, false); _tracking.VirtualMemoryEvent(0, 4, false);
bool dirtyAfterRead = handle.Dirty; bool dirtyAfterRead = handle.Dirty;
Assert.False(dirtyAfterRead); // Not dirtied, as this was a read. Assert.That(dirtyAfterRead, Is.False); // Not dirtied, as this was a read.
Assert.AreEqual(readTrackingTriggered, (0UL, 4UL)); // Read action was triggered. Assert.That(readTrackingTriggered, Is.EqualTo((0UL, 4UL))); // Read action was triggered.
Assert.AreEqual(MemoryPermission.Read, protection); // Write protection is still present. Assert.That(MemoryPermission.Read, Is.EqualTo(protection)); // Write protection is still present.
readTrackingTriggered = null; readTrackingTriggered = null;
@ -444,11 +444,11 @@ namespace Ryujinx.Tests.Memory
_tracking.VirtualMemoryEvent(0, 4, true); _tracking.VirtualMemoryEvent(0, 4, true);
bool dirtyAfterWriteAfterRead = handle.Dirty; bool dirtyAfterWriteAfterRead = handle.Dirty;
Assert.True(dirtyAfterWriteAfterRead); // Should be dirty. Assert.That(dirtyAfterWriteAfterRead, Is.True); // Should be dirty.
Assert.AreEqual(MemoryPermission.ReadAndWrite, protection); // All protection is now be removed from the memory. Assert.That(MemoryPermission.ReadAndWrite, Is.EqualTo(protection)); // All protection is now be removed from the memory.
Assert.IsNull(readTrackingTriggered); // Read tracking was removed when the action fired, as it can only fire once. Assert.That(readTrackingTriggered, Is.Null); // Read tracking was removed when the action fired, as it can only fire once.
handle.Dispose(); handle.Dispose();
} }
@ -476,22 +476,22 @@ namespace Ryujinx.Tests.Memory
_tracking.VirtualMemoryEvent(0, 4, false, precise: true); _tracking.VirtualMemoryEvent(0, 4, false, precise: true);
Assert.IsNull(readTrackingTriggered); // Hasn't been triggered - precise action returned true. Assert.That(readTrackingTriggered, Is.Null); // Hasn't been triggered - precise action returned true.
Assert.AreEqual(preciseTriggered, (0UL, 4UL, false)); // Precise action was triggered. Assert.That(preciseTriggered, Is.EqualTo((0UL, 4UL, false))); // Precise action was triggered.
_tracking.VirtualMemoryEvent(0, 4, true, precise: true); _tracking.VirtualMemoryEvent(0, 4, true, precise: true);
Assert.IsNull(readTrackingTriggered); // Still hasn't been triggered. Assert.That(readTrackingTriggered, Is.Null); // Still hasn't been triggered.
bool dirtyAfterPreciseActionTrue = handle.Dirty; bool dirtyAfterPreciseActionTrue = handle.Dirty;
Assert.False(dirtyAfterPreciseActionTrue); // Not dirtied - precise action returned true. Assert.That(dirtyAfterPreciseActionTrue, Is.False); // Not dirtied - precise action returned true.
Assert.AreEqual(preciseTriggered, (0UL, 4UL, true)); // Precise action was triggered. Assert.That(preciseTriggered, Is.EqualTo((0UL, 4UL, true))); // Precise action was triggered.
// Handle is now dirty. // Handle is now dirty.
handle.Reprotect(true); handle.Reprotect(true);
preciseTriggered = null; preciseTriggered = null;
_tracking.VirtualMemoryEvent(4, 4, true, precise: true); _tracking.VirtualMemoryEvent(4, 4, true, precise: true);
Assert.AreEqual(preciseTriggered, (4UL, 4UL, true)); // Precise action was triggered even though handle was dirty. Assert.That(preciseTriggered, Is.EqualTo((4UL, 4UL, true))); // Precise action was triggered even though handle was dirty.
handle.Reprotect(); handle.Reprotect();
handle.RegisterPreciseAction((address, size, write) => handle.RegisterPreciseAction((address, size, write) =>
@ -503,10 +503,10 @@ namespace Ryujinx.Tests.Memory
_tracking.VirtualMemoryEvent(8, 4, true, precise: true); _tracking.VirtualMemoryEvent(8, 4, true, precise: true);
Assert.AreEqual(readTrackingTriggered, (8UL, 4UL)); // Read action triggered, as precise action returned false. Assert.That(readTrackingTriggered, Is.EqualTo((8UL, 4UL))); // Read action triggered, as precise action returned false.
bool dirtyAfterPreciseActionFalse = handle.Dirty; bool dirtyAfterPreciseActionFalse = handle.Dirty;
Assert.True(dirtyAfterPreciseActionFalse); // Dirtied, as precise action returned false. Assert.That(dirtyAfterPreciseActionFalse, Is.True); // Dirtied, as precise action returned false.
Assert.AreEqual(preciseTriggered, (8UL, 4UL, true)); // Precise action was triggered. Assert.That(preciseTriggered, Is.EqualTo((8UL, 4UL, true))); // Precise action was triggered.
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x34, Unsafe.SizeOf<AudioRendererConfiguration>()); Assert.That(0x34, Is.EqualTo(Unsafe.SizeOf<AudioRendererConfiguration>()));
} }
} }
} }

View file

@ -9,8 +9,8 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<BehaviourParameter>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<BehaviourParameter>()));
Assert.AreEqual(0x10, Unsafe.SizeOf<BehaviourParameter.ErrorInfo>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<BehaviourParameter.ErrorInfo>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xC, Unsafe.SizeOf<BiquadFilterParameter>()); Assert.That(0xC, Is.EqualTo(Unsafe.SizeOf<BiquadFilterParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Common
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x40, Unsafe.SizeOf<UpdateDataHeader>()); Assert.That(0x40, Is.EqualTo(Unsafe.SizeOf<UpdateDataHeader>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Common
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.LessOrEqual(Unsafe.SizeOf<VoiceUpdateState>(), 0x100); Assert.That(Unsafe.SizeOf<VoiceUpdateState>(), Is.LessThanOrEqualTo(0x100));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Common
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x30, Unsafe.SizeOf<WaveBuffer>()); Assert.That(0x30, Is.EqualTo(Unsafe.SizeOf<WaveBuffer>()));
} }
} }
} }

View file

@ -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.That(thisDelta < 0.1f, Is.True);
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.That(sumDifference < 0.01f, Is.True);
} }
} }
} }

View file

@ -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.That(sumDifference < 0.02f, Is.True);
} }
} }
} }

View file

@ -9,8 +9,8 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xC0, Unsafe.SizeOf<EffectInParameterVersion1>()); Assert.That(0xC0, Is.EqualTo(Unsafe.SizeOf<EffectInParameterVersion1>()));
Assert.AreEqual(0xC0, Unsafe.SizeOf<EffectInParameterVersion2>()); Assert.That(0xC0, Is.EqualTo(Unsafe.SizeOf<EffectInParameterVersion2>()));
} }
} }
} }

View file

@ -9,8 +9,8 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<EffectOutStatusVersion1>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<EffectOutStatusVersion1>()));
Assert.AreEqual(0x90, Unsafe.SizeOf<EffectOutStatusVersion2>()); Assert.That(0x90, Is.EqualTo(Unsafe.SizeOf<EffectOutStatusVersion2>()));
} }
} }
} }

View file

@ -9,8 +9,8 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<MemoryPoolInParameter>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<MemoryPoolInParameter>()));
Assert.AreEqual(0x10, Unsafe.SizeOf<MemoryPoolOutStatus>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<MemoryPoolOutStatus>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xB0, Unsafe.SizeOf<BehaviourErrorInfoOutStatus>()); Assert.That(0xB0, Is.EqualTo(Unsafe.SizeOf<BehaviourErrorInfoOutStatus>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x6C, Unsafe.SizeOf<AuxiliaryBufferParameter>()); Assert.That(0x6C, Is.EqualTo(Unsafe.SizeOf<AuxiliaryBufferParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x18, Unsafe.SizeOf<BiquadFilterEffectParameter>()); Assert.That(0x18, Is.EqualTo(Unsafe.SizeOf<BiquadFilterEffectParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x94, Unsafe.SizeOf<BufferMixParameter>()); Assert.That(0x94, Is.EqualTo(Unsafe.SizeOf<BufferMixParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x38, Unsafe.SizeOf<CompressorParameter>()); Assert.That(0x38, Is.EqualTo(Unsafe.SizeOf<CompressorParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x35, Unsafe.SizeOf<DelayParameter>()); Assert.That(0x35, Is.EqualTo(Unsafe.SizeOf<DelayParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x44, Unsafe.SizeOf<LimiterParameter>()); Assert.That(0x44, Is.EqualTo(Unsafe.SizeOf<LimiterParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x30, Unsafe.SizeOf<LimiterStatistics>()); Assert.That(0x30, Is.EqualTo(Unsafe.SizeOf<LimiterStatistics>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x49, Unsafe.SizeOf<Reverb3dParameter>()); Assert.That(0x49, Is.EqualTo(Unsafe.SizeOf<Reverb3dParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Effect
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x41, Unsafe.SizeOf<ReverbParameter>()); Assert.That(0x41, Is.EqualTo(Unsafe.SizeOf<ReverbParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<MixInParameterDirtyOnlyUpdate>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<MixInParameterDirtyOnlyUpdate>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x930, Unsafe.SizeOf<MixParameter>()); Assert.That(0x930, Is.EqualTo(Unsafe.SizeOf<MixParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<PerformanceInParameter>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<PerformanceInParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<PerformanceOutStatus>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<PerformanceOutStatus>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<RendererInfoOutStatus>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<RendererInfoOutStatus>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x24, Unsafe.SizeOf<CircularBufferParameter>()); Assert.That(0x24, Is.EqualTo(Unsafe.SizeOf<CircularBufferParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter.Sink
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x11C, Unsafe.SizeOf<DeviceParameter>()); Assert.That(0x11C, Is.EqualTo(Unsafe.SizeOf<DeviceParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x140, Unsafe.SizeOf<SinkInParameter>()); Assert.That(0x140, Is.EqualTo(Unsafe.SizeOf<SinkInParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SinkOutStatus>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<SinkOutStatus>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Parameter
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SplitterInParameterHeader>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<SplitterInParameterHeader>()));
} }
} }
} }

View file

@ -10,7 +10,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<AddressInfo>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<AddressInfo>()));
} }
[Test] [Test]
@ -25,11 +25,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
addressInfo.ForceMappedDspAddress = 0x2000000; addressInfo.ForceMappedDspAddress = 0x2000000;
Assert.AreEqual(0x2000000, addressInfo.GetReference(true)); Assert.That(0x2000000, Is.EqualTo(addressInfo.GetReference(true)));
addressInfo.SetupMemoryPool(memoryPoolState.AsSpan()); addressInfo.SetupMemoryPool(memoryPoolState.AsSpan());
Assert.AreEqual(0x4000000, addressInfo.GetReference(true)); Assert.That(0x4000000, Is.EqualTo(addressInfo.GetReference(true)));
} }
} }
} }

View file

@ -12,11 +12,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
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.That(BehaviourContext.CheckFeatureSupported(latestRevision, latestRevision), Is.True);
Assert.IsFalse(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision)); Assert.That(BehaviourContext.CheckFeatureSupported(previousRevision, latestRevision), Is.False);
Assert.IsTrue(BehaviourContext.CheckFeatureSupported(latestRevision, previousRevision)); Assert.That(BehaviourContext.CheckFeatureSupported(latestRevision, previousRevision), Is.True);
// 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.That(BehaviourContext.CheckFeatureSupported(invalidRevision, latestRevision), Is.True);
} }
[Test] [Test]
@ -26,11 +26,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1);
Assert.IsFalse(behaviourContext.IsMemoryPoolForceMappingEnabled()); Assert.That(behaviourContext.IsMemoryPoolForceMappingEnabled(), Is.False);
behaviourContext.UpdateFlags(0x1); behaviourContext.UpdateFlags(0x1);
Assert.IsTrue(behaviourContext.IsMemoryPoolForceMappingEnabled()); Assert.That(behaviourContext.IsMemoryPoolForceMappingEnabled(), Is.True);
} }
[Test] [Test]
@ -40,25 +40,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision1);
Assert.IsFalse(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.False);
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.70f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(1, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(1, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -68,25 +68,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision2); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision2);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsFalse(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.False);
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.70f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(1, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(1, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -96,25 +96,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision3); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision3);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsFalse(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.70f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.70f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(1, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(1, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -124,25 +124,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.75f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(1, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(1, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -152,25 +152,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision5); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision5);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.False);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(2, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -180,25 +180,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision6); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision6);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(2, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -208,25 +208,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision7); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision7);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(2, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(2, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -236,25 +236,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision8); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision8);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.True);
Assert.IsFalse(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.False);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(3, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -264,25 +264,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision9); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision9);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.True);
Assert.IsFalse(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.False);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(3, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(3, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -292,25 +292,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision10); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision10);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.True);
Assert.IsFalse(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.False);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(4, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(4, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -320,25 +320,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision11); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision11);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.True);
Assert.IsTrue(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.True);
Assert.IsFalse(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.False);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(5, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(5, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
[Test] [Test]
@ -348,25 +348,25 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision12); behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision12);
Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed()); Assert.That(behaviourContext.IsAdpcmLoopContextBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterSupported()); Assert.That(behaviourContext.IsSplitterSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported()); Assert.That(behaviourContext.IsLongSizePreDelaySupported(), Is.True);
Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported()); Assert.That(behaviourContext.IsAudioUsbDeviceOutputSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsFlushVoiceWaveBuffersSupported()); Assert.That(behaviourContext.IsFlushVoiceWaveBuffersSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsSplitterBugFixed()); Assert.That(behaviourContext.IsSplitterBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsElapsedFrameCountSupported()); Assert.That(behaviourContext.IsElapsedFrameCountSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsDecodingBehaviourFlagSupported()); Assert.That(behaviourContext.IsDecodingBehaviourFlagSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterEffectStateClearBugFixed()); Assert.That(behaviourContext.IsBiquadFilterEffectStateClearBugFixed(), Is.True);
Assert.IsTrue(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported()); Assert.That(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsWaveBufferVersion2Supported()); Assert.That(behaviourContext.IsWaveBufferVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.IsEffectInfoVersion2Supported()); Assert.That(behaviourContext.IsEffectInfoVersion2Supported(), Is.True);
Assert.IsTrue(behaviourContext.UseMultiTapBiquadFilterProcessing()); Assert.That(behaviourContext.UseMultiTapBiquadFilterProcessing(), Is.True);
Assert.IsTrue(behaviourContext.IsNewEffectChannelMappingSupported()); Assert.That(behaviourContext.IsNewEffectChannelMappingSupported(), Is.True);
Assert.IsTrue(behaviourContext.IsBiquadFilterParameterForSplitterEnabled()); Assert.That(behaviourContext.IsBiquadFilterParameterForSplitterEnabled(), Is.True);
Assert.AreEqual(0.80f, behaviourContext.GetAudioRendererProcessingTimeLimit()); Assert.That(0.80f, Is.EqualTo(behaviourContext.GetAudioRendererProcessingTimeLimit()));
Assert.AreEqual(5, behaviourContext.GetCommandProcessingTimeEstimatorVersion()); Assert.That(5, Is.EqualTo(behaviourContext.GetCommandProcessingTimeEstimatorVersion()));
Assert.AreEqual(2, behaviourContext.GetPerformanceMetricsDataFormat()); Assert.That(2, Is.EqualTo(behaviourContext.GetPerformanceMetricsDataFormat()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(Unsafe.SizeOf<MemoryPoolState>(), 0x20); Assert.That(Unsafe.SizeOf<MemoryPoolState>(), Is.EqualTo(0x20));
} }
[Test] [Test]
@ -21,12 +21,12 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.IsTrue(memoryPool.Contains(0x1000000, 0x10)); Assert.That(memoryPool.Contains(0x1000000, 0x10), Is.True);
Assert.IsTrue(memoryPool.Contains(0x1000FE0, 0x10)); Assert.That(memoryPool.Contains(0x1000FE0, 0x10), Is.True);
Assert.IsTrue(memoryPool.Contains(0x1000FFF, 0x1)); Assert.That(memoryPool.Contains(0x1000FFF, 0x1), Is.True);
Assert.IsFalse(memoryPool.Contains(0x1000FFF, 0x2)); Assert.That(memoryPool.Contains(0x1000FFF, 0x2), Is.False);
Assert.IsFalse(memoryPool.Contains(0x1001000, 0x10)); Assert.That(memoryPool.Contains(0x1001000, 0x10), Is.False);
Assert.IsFalse(memoryPool.Contains(0x2000000, 0x10)); Assert.That(memoryPool.Contains(0x2000000, 0x10), Is.False);
} }
[Test] [Test]
@ -38,11 +38,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.AreEqual(0x2000FE0, memoryPool.Translate(0x1000FE0, 0x10)); Assert.That(0x2000FE0, Is.EqualTo(memoryPool.Translate(0x1000FE0, 0x10)));
Assert.AreEqual(0x2000FFF, memoryPool.Translate(0x1000FFF, 0x1)); Assert.That(0x2000FFF, Is.EqualTo(memoryPool.Translate(0x1000FFF, 0x1)));
Assert.AreEqual(0x0, memoryPool.Translate(0x1000FFF, 0x2)); Assert.That(0x0, Is.EqualTo(memoryPool.Translate(0x1000FFF, 0x2)));
Assert.AreEqual(0x0, memoryPool.Translate(0x1001000, 0x10)); Assert.That(0x0, Is.EqualTo(memoryPool.Translate(0x1001000, 0x10)));
Assert.AreEqual(0x0, memoryPool.Translate(0x2000000, 0x10)); Assert.That(0x0, Is.EqualTo(memoryPool.Translate(0x2000000, 0x10)));
} }
[Test] [Test]
@ -52,11 +52,11 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
memoryPool.SetCpuAddress(0x1000000, 0x1000); memoryPool.SetCpuAddress(0x1000000, 0x1000);
Assert.IsFalse(memoryPool.IsMapped()); Assert.That(memoryPool.IsMapped(), Is.False);
memoryPool.DspAddress = 0x2000000; memoryPool.DspAddress = 0x2000000;
Assert.IsTrue(memoryPool.IsMapped()); Assert.That(memoryPool.IsMapped(), Is.True);
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x940, Unsafe.SizeOf<MixState>()); Assert.That(0x940, Is.EqualTo(Unsafe.SizeOf<MixState>()));
} }
} }
} }

View file

@ -23,12 +23,12 @@ 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.That(poolMapper.InitializeSystemPool(ref memoryPoolCpu, CpuAddress, CpuSize), Is.False);
Assert.IsTrue(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize)); Assert.That(poolMapper.InitializeSystemPool(ref memoryPoolDsp, CpuAddress, CpuSize), Is.True);
Assert.AreEqual(CpuAddress, memoryPoolDsp.CpuAddress); Assert.That(CpuAddress, Is.EqualTo(memoryPoolDsp.CpuAddress));
Assert.AreEqual(CpuSize, memoryPoolDsp.Size); Assert.That(CpuSize, Is.EqualTo(memoryPoolDsp.Size));
Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); Assert.That(DspAddress, Is.EqualTo(memoryPoolDsp.DspAddress));
} }
[Test] [Test]
@ -38,8 +38,8 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
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.That(0xFFFF8001, Is.EqualTo(poolMapper.GetProcessHandle(ref memoryPoolCpu)));
Assert.AreEqual(DummyProcessHandle, poolMapper.GetProcessHandle(ref memoryPoolDsp)); Assert.That(DummyProcessHandle, Is.EqualTo(poolMapper.GetProcessHandle(ref memoryPoolDsp)));
} }
[Test] [Test]
@ -56,15 +56,15 @@ 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.That(DspAddress, Is.EqualTo(poolMapper.Map(ref memoryPoolCpu)));
Assert.AreEqual(DspAddress, poolMapper.Map(ref memoryPoolDsp)); Assert.That(DspAddress, Is.EqualTo(poolMapper.Map(ref memoryPoolDsp)));
Assert.AreEqual(DspAddress, memoryPoolDsp.DspAddress); Assert.That(DspAddress, Is.EqualTo(memoryPoolDsp.DspAddress));
Assert.IsTrue(poolMapper.Unmap(ref memoryPoolCpu)); Assert.That(poolMapper.Unmap(ref memoryPoolCpu), Is.True);
memoryPoolDsp.IsUsed = true; memoryPoolDsp.IsUsed = true;
Assert.IsFalse(poolMapper.Unmap(ref memoryPoolDsp)); Assert.That(poolMapper.Unmap(ref memoryPoolDsp), Is.False);
memoryPoolDsp.IsUsed = false; memoryPoolDsp.IsUsed = false;
Assert.IsTrue(poolMapper.Unmap(ref memoryPoolDsp)); Assert.That(poolMapper.Unmap(ref memoryPoolDsp), Is.True);
} }
[Test] [Test]
@ -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.That(poolMapper.TryAttachBuffer(out ErrorInfo errorInfo, ref addressInfo, 0, 0), Is.True);
Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); Assert.That(ResultCode.InvalidAddressInfo, Is.EqualTo(errorInfo.ErrorCode));
Assert.AreEqual(0, errorInfo.ExtraErrorInfo); Assert.That(0, Is.EqualTo(errorInfo.ExtraErrorInfo));
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.That(0, Is.EqualTo(addressInfo.ForceMappedDspAddress));
Assert.IsTrue(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); Assert.That(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize), Is.True);
Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); Assert.That(ResultCode.InvalidAddressInfo, Is.EqualTo(errorInfo.ErrorCode));
Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); Assert.That(CpuAddress, Is.EqualTo(errorInfo.ExtraErrorInfo));
Assert.AreEqual(DspAddress, addressInfo.ForceMappedDspAddress); Assert.That(DspAddress, Is.EqualTo(addressInfo.ForceMappedDspAddress));
poolMapper = new PoolMapper(DummyProcessHandle, false); poolMapper = new PoolMapper(DummyProcessHandle, false);
Assert.IsFalse(poolMapper.TryAttachBuffer(out _, ref addressInfo, 0, 0)); Assert.That(poolMapper.TryAttachBuffer(out _, ref addressInfo, 0, 0), Is.False);
addressInfo.ForceMappedDspAddress = 0; addressInfo.ForceMappedDspAddress = 0;
Assert.IsFalse(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); Assert.That(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize), Is.False);
Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); Assert.That(ResultCode.InvalidAddressInfo, Is.EqualTo(errorInfo.ErrorCode));
Assert.AreEqual(CpuAddress, errorInfo.ExtraErrorInfo); Assert.That(CpuAddress, Is.EqualTo(errorInfo.ExtraErrorInfo));
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.That(0, Is.EqualTo(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.That(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddressRegionEnding, CpuSize), Is.False);
Assert.AreEqual(ResultCode.InvalidAddressInfo, errorInfo.ErrorCode); Assert.That(ResultCode.InvalidAddressInfo, Is.EqualTo(errorInfo.ErrorCode));
Assert.AreEqual(CpuAddressRegionEnding, errorInfo.ExtraErrorInfo); Assert.That(CpuAddressRegionEnding, Is.EqualTo(errorInfo.ExtraErrorInfo));
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.That(0, Is.EqualTo(addressInfo.ForceMappedDspAddress));
Assert.IsFalse(addressInfo.HasMemoryPoolState); Assert.That(addressInfo.HasMemoryPoolState, Is.False);
Assert.IsTrue(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize)); Assert.That(poolMapper.TryAttachBuffer(out errorInfo, ref addressInfo, CpuAddress, CpuSize), Is.True);
Assert.AreEqual(ResultCode.Success, errorInfo.ErrorCode); Assert.That(ResultCode.Success, Is.EqualTo(errorInfo.ErrorCode));
Assert.AreEqual(0, errorInfo.ExtraErrorInfo); Assert.That(0, Is.EqualTo(errorInfo.ExtraErrorInfo));
Assert.AreEqual(0, addressInfo.ForceMappedDspAddress); Assert.That(0, Is.EqualTo(addressInfo.ForceMappedDspAddress));
Assert.IsTrue(addressInfo.HasMemoryPoolState); Assert.That(addressInfo.HasMemoryPoolState, Is.True);
} }
} }
} }

View file

@ -9,8 +9,8 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xE0, Unsafe.SizeOf<SplitterDestinationVersion1>()); Assert.That(0xE0, Is.EqualTo(Unsafe.SizeOf<SplitterDestinationVersion1>()));
Assert.AreEqual(0x110, Unsafe.SizeOf<SplitterDestinationVersion2>()); Assert.That(0x110, Is.EqualTo(Unsafe.SizeOf<SplitterDestinationVersion2>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x20, Unsafe.SizeOf<SplitterState>()); Assert.That(0x20, Is.EqualTo(Unsafe.SizeOf<SplitterState>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0xD0, Unsafe.SizeOf<VoiceChannelResource>()); Assert.That(0xD0, Is.EqualTo(Unsafe.SizeOf<VoiceChannelResource>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.LessOrEqual(Unsafe.SizeOf<VoiceState>(), 0x220); Assert.That(Unsafe.SizeOf<VoiceState>(), Is.LessThanOrEqualTo(0x220));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer.Server
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x58, Unsafe.SizeOf<WaveBuffer>()); Assert.That(0x58, Is.EqualTo(Unsafe.SizeOf<WaveBuffer>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x70, Unsafe.SizeOf<VoiceChannelResourceInParameter>()); Assert.That(0x70, Is.EqualTo(Unsafe.SizeOf<VoiceChannelResourceInParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x170, Unsafe.SizeOf<VoiceInParameter>()); Assert.That(0x170, Is.EqualTo(Unsafe.SizeOf<VoiceInParameter>()));
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace Ryujinx.Tests.Audio.Renderer
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x10, Unsafe.SizeOf<VoiceOutStatus>()); Assert.That(0x10, Is.EqualTo(Unsafe.SizeOf<VoiceOutStatus>()));
} }
} }
} }

View file

@ -31,7 +31,7 @@ namespace Ryujinx.Tests.Common.Extensions
ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _); ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _);
// Assert // Assert
MyUnmanagedStruct.Assert(Assert.AreEqual, original, read); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), original, read);
} }
} }
@ -51,8 +51,8 @@ namespace Ryujinx.Tests.Common.Extensions
ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out var copy); ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out var copy);
// Assert // Assert
MyUnmanagedStruct.Assert(Assert.AreEqual, original, read); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), original, read);
MyUnmanagedStruct.Assert(Assert.AreEqual, read, copy); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), read, copy);
} }
} }
@ -72,8 +72,8 @@ namespace Ryujinx.Tests.Common.Extensions
ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out var copy); ref readonly MyUnmanagedStruct read = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out var copy);
// Assert // Assert
MyUnmanagedStruct.Assert(Assert.AreEqual, original, read); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), original, read);
MyUnmanagedStruct.Assert(Assert.AreNotEqual, read, copy); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.Not.EqualTo(actual)), read, copy);
} }
} }
@ -112,7 +112,7 @@ namespace Ryujinx.Tests.Common.Extensions
sequenceReader.ReadLittleEndian(out int roundTrippedValue); sequenceReader.ReadLittleEndian(out int roundTrippedValue);
// Assert // Assert
Assert.AreEqual(TestValue, roundTrippedValue); Assert.That(TestValue, Is.EqualTo(roundTrippedValue));
} }
[Test] [Test]
@ -131,7 +131,7 @@ namespace Ryujinx.Tests.Common.Extensions
sequenceReader.ReadLittleEndian(out int roundTrippedValue); sequenceReader.ReadLittleEndian(out int roundTrippedValue);
// Assert // Assert
Assert.AreNotEqual(TestValue, roundTrippedValue); Assert.That(TestValue, Is.Not.EqualTo(roundTrippedValue));
} }
[Test] [Test]
@ -221,7 +221,7 @@ namespace Ryujinx.Tests.Common.Extensions
sequenceReader.ReadUnmanaged(out MyUnmanagedStruct read); sequenceReader.ReadUnmanaged(out MyUnmanagedStruct read);
// Assert // Assert
MyUnmanagedStruct.Assert(Assert.AreEqual, original, read); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), original, read);
} }
} }
@ -237,19 +237,19 @@ namespace Ryujinx.Tests.Common.Extensions
static void SetConsumedAndAssert(scoped ref SequenceReader<byte> sequenceReader, long consumed) static void SetConsumedAndAssert(scoped ref SequenceReader<byte> sequenceReader, long consumed)
{ {
sequenceReader.SetConsumed(consumed); sequenceReader.SetConsumed(consumed);
Assert.AreEqual(consumed, sequenceReader.Consumed); Assert.That(consumed, Is.EqualTo(sequenceReader.Consumed));
} }
// Act/Assert // Act/Assert
ref readonly MyUnmanagedStruct struct0A = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _); ref readonly MyUnmanagedStruct struct0A = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _);
Assert.AreEqual(sequenceReader.Consumed, MyUnmanagedStruct.SizeOf); Assert.That(sequenceReader.Consumed, Is.EqualTo(MyUnmanagedStruct.SizeOf));
SetConsumedAndAssert(ref sequenceReader, 0); SetConsumedAndAssert(ref sequenceReader, 0);
ref readonly MyUnmanagedStruct struct0B = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _); ref readonly MyUnmanagedStruct struct0B = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _);
MyUnmanagedStruct.Assert(Assert.AreEqual, struct0A, struct0B); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), struct0A, struct0B);
SetConsumedAndAssert(ref sequenceReader, 1); SetConsumedAndAssert(ref sequenceReader, 1);
@ -261,7 +261,7 @@ namespace Ryujinx.Tests.Common.Extensions
ref readonly MyUnmanagedStruct struct1B = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _); ref readonly MyUnmanagedStruct struct1B = ref sequenceReader.GetRefOrRefToCopy<MyUnmanagedStruct>(out _);
MyUnmanagedStruct.Assert(Assert.AreEqual, struct1A, struct1B); MyUnmanagedStruct.Assert((expected, actual) => Assert.That(expected, Is.EqualTo(actual)), struct1A, struct1B);
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]

View file

@ -43,7 +43,7 @@ namespace Ryujinx.Tests.Cpu
// Subnormal results are not flushed to zero by default. // Subnormal results are not flushed to zero by default.
// This operation should not be allowed to do constant propagation, hence the methods that explicitly disallow inlining. // This operation should not be allowed to do constant propagation, hence the methods that explicitly disallow inlining.
Assert.AreNotEqual(GetDenormal() + GetZero(), 0f); Assert.That(GetDenormal() + GetZero(), Is.Not.EqualTo(0f));
bool methodCalled = false; bool methodCalled = false;
bool isFz = false; bool isFz = false;
@ -56,11 +56,11 @@ namespace Ryujinx.Tests.Cpu
int result = method(Marshal.GetFunctionPointerForDelegate(ManagedMethod)); int result = method(Marshal.GetFunctionPointerForDelegate(ManagedMethod));
// Subnormal results are not flushed to zero by default, which we should have returned to exiting the method. // Subnormal results are not flushed to zero by default, which we should have returned to exiting the method.
Assert.AreNotEqual(GetDenormal() + GetZero(), 0f); Assert.That(GetDenormal() + GetZero(), Is.Not.EqualTo(0f));
Assert.True(result == 0); Assert.That(result, Is.EqualTo(0));
Assert.True(methodCalled); Assert.That(methodCalled, Is.True);
Assert.True(isFz); Assert.That(isFz, Is.True);
return; return;
void ManagedMethod() void ManagedMethod()

View file

@ -9,13 +9,13 @@ namespace Ryujinx.Tests.HLE
[Test] [Test]
public void StripUnicodeControlCodes_NullInput() public void StripUnicodeControlCodes_NullInput()
{ {
Assert.IsNull(SoftwareKeyboardApplet.StripUnicodeControlCodes(null)); Assert.That(SoftwareKeyboardApplet.StripUnicodeControlCodes(null), Is.Null);
} }
[Test] [Test]
public void StripUnicodeControlCodes_EmptyInput() public void StripUnicodeControlCodes_EmptyInput()
{ {
Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(string.Empty)); Assert.That(string.Empty, Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes(string.Empty)));
} }
[Test] [Test]
@ -34,14 +34,14 @@ namespace Ryujinx.Tests.HLE
foreach (string prompt in prompts) foreach (string prompt in prompts)
{ {
Assert.AreEqual(prompt, SoftwareKeyboardApplet.StripUnicodeControlCodes(prompt)); Assert.That(prompt, Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes(prompt)));
} }
} }
[Test] [Test]
public void StripUnicodeControlCodes_StripsNewlines() public void StripUnicodeControlCodes_StripsNewlines()
{ {
Assert.AreEqual("I am very tall", SoftwareKeyboardApplet.StripUnicodeControlCodes("I \r\nam \r\nvery \r\ntall")); Assert.That("I am very tall", Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes("I \r\nam \r\nvery \r\ntall")));
} }
[Test] [Test]
@ -49,14 +49,14 @@ namespace Ryujinx.Tests.HLE
{ {
// 0x13 is control code DC3 used by some games // 0x13 is control code DC3 used by some games
string specialInput = Encoding.UTF8.GetString(new byte[] { 0x13, 0x53, 0x68, 0x69, 0x6E, 0x65, 0x13 }); string specialInput = Encoding.UTF8.GetString(new byte[] { 0x13, 0x53, 0x68, 0x69, 0x6E, 0x65, 0x13 });
Assert.AreEqual("Shine", SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); Assert.That("Shine", Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)));
} }
[Test] [Test]
public void StripUnicodeControlCodes_StripsToEmptyString() public void StripUnicodeControlCodes_StripsToEmptyString()
{ {
string specialInput = Encoding.UTF8.GetString(new byte[] { 17, 18, 19, 20 }); // DC1 - DC4 special codes string specialInput = Encoding.UTF8.GetString(new byte[] { 17, 18, 19, 20 }); // DC1 - DC4 special codes
Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); Assert.That(string.Empty, Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)));
} }
[Test] [Test]
@ -64,7 +64,7 @@ namespace Ryujinx.Tests.HLE
{ {
// Turtles are a good example of multi-codepoint Unicode chars // Turtles are a good example of multi-codepoint Unicode chars
string specialInput = "♀ 🐢 🐢 ♂ "; string specialInput = "♀ 🐢 🐢 ♂ ";
Assert.AreEqual(specialInput, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); Assert.That(specialInput, Is.EqualTo(SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)));
} }
} }
} }

View file

@ -154,13 +154,13 @@ namespace Ryujinx.Tests.Memory
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
{ {
// One thread should be present on the thread local map. Trimming should remove it. // One thread should be present on the thread local map. Trimming should remove it.
Assert.AreEqual(1, CountThreads(ref state)); Assert.That(1, Is.EqualTo(CountThreads(ref state)));
} }
shouldAccess = false; shouldAccess = false;
testThread.Join(); testThread.Join();
Assert.False(error); Assert.That(error, Is.False);
string test = null; string test = null;
@ -177,7 +177,7 @@ namespace Ryujinx.Tests.Memory
{ {
state.TrimThreads(); state.TrimThreads();
Assert.AreEqual(0, CountThreads(ref state)); Assert.That(0, Is.EqualTo(CountThreads(ref state)));
} }
/* /*
@ -267,7 +267,7 @@ namespace Ryujinx.Tests.Memory
writeLoopState.Running = 0; writeLoopState.Running = 0;
testThread.Join(); testThread.Join();
Assert.False(writeLoopState.Error != 0); Assert.That(writeLoopState.Error != 0, Is.False);
} }
finally finally
{ {
@ -302,11 +302,11 @@ namespace Ryujinx.Tests.Memory
testThread.Start(); testThread.Start();
Thread.Sleep(200); Thread.Sleep(200);
Assert.AreEqual(1, CountThreads(ref state)); Assert.That(1, Is.EqualTo(CountThreads(ref state)));
// Trimming should not remove the thread as it's still active. // Trimming should not remove the thread as it's still active.
state.TrimThreads(); state.TrimThreads();
Assert.AreEqual(1, CountThreads(ref state)); Assert.That(1, Is.EqualTo(CountThreads(ref state)));
running = false; running = false;
@ -314,7 +314,7 @@ namespace Ryujinx.Tests.Memory
// Should trim now that it's inactive. // Should trim now that it's inactive.
state.TrimThreads(); state.TrimThreads();
Assert.AreEqual(0, CountThreads(ref state)); Assert.That(0, Is.EqualTo(CountThreads(ref state)));
} }
[Test] [Test]
@ -335,35 +335,35 @@ namespace Ryujinx.Tests.Memory
for (int i = 0; i < ThreadLocalMap<int>.MapSize; i++) for (int i = 0; i < ThreadLocalMap<int>.MapSize; i++)
{ {
// Should obtain the index matching the call #. // Should obtain the index matching the call #.
Assert.AreEqual(i, getOrReserve(i + 1, i)); Assert.That(i, Is.EqualTo(getOrReserve(i + 1, i)));
// Check that this and all previously reserved thread IDs and struct contents are intact. // Check that this and all previously reserved thread IDs and struct contents are intact.
for (int j = 0; j <= i; j++) for (int j = 0; j <= i; j++)
{ {
Assert.AreEqual(j + 1, state.LocalCounts.ThreadIds[j]); Assert.That(j + 1, Is.EqualTo(state.LocalCounts.ThreadIds[j]));
Assert.AreEqual(j, state.LocalCounts.Structs[j]); Assert.That(j, Is.EqualTo(state.LocalCounts.Structs[j]));
} }
} }
// Trying to reserve again when the map is full should return -1. // Trying to reserve again when the map is full should return -1.
Assert.AreEqual(-1, getOrReserve(200, 0)); Assert.That(-1, Is.EqualTo(getOrReserve(200, 0)));
for (int i = 0; i < ThreadLocalMap<int>.MapSize; i++) for (int i = 0; i < ThreadLocalMap<int>.MapSize; i++)
{ {
// Should obtain the index matching the call #, as it already exists. // Should obtain the index matching the call #, as it already exists.
Assert.AreEqual(i, getOrReserve(i + 1, -1)); Assert.That(i, Is.EqualTo(getOrReserve(i + 1, -1)));
// The struct should not be reset to -1. // The struct should not be reset to -1.
Assert.AreEqual(i, state.LocalCounts.Structs[i]); Assert.That(i, Is.EqualTo(state.LocalCounts.Structs[i]));
} }
// Clear one of the ids as if it were freed. // Clear one of the ids as if it were freed.
state.LocalCounts.ThreadIds[13] = 0; state.LocalCounts.ThreadIds[13] = 0;
// GetOrReserve should now obtain and return 13. // GetOrReserve should now obtain and return 13.
Assert.AreEqual(13, getOrReserve(300, 301)); Assert.That(13, Is.EqualTo(getOrReserve(300, 301)));
Assert.AreEqual(300, state.LocalCounts.ThreadIds[13]); Assert.That(300, Is.EqualTo(state.LocalCounts.ThreadIds[13]));
Assert.AreEqual(301, state.LocalCounts.Structs[13]); Assert.That(301, Is.EqualTo(state.LocalCounts.Structs[13]));
} }
} }
@ -462,7 +462,7 @@ namespace Ryujinx.Tests.Memory
thread.Join(); thread.Join();
} }
Assert.False(error); Assert.That(error, Is.False);
} }
} }
} }

View file

@ -11,7 +11,7 @@ namespace Ryujinx.Tests.Time
[Test] [Test]
public void EnsureTypeSize() public void EnsureTypeSize()
{ {
Assert.AreEqual(0x4000, Unsafe.SizeOf<TimeZoneRule>()); Assert.That(0x4000, Is.EqualTo(Unsafe.SizeOf<TimeZoneRule>()));
} }
} }
} }

View file

@ -3,7 +3,7 @@ using Ryujinx.Common.Collections;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Tests.Collections namespace Ryujinx.Tests
{ {
class TreeDictionaryTests class TreeDictionaryTests
{ {
@ -12,7 +12,7 @@ namespace Ryujinx.Tests.Collections
{ {
TreeDictionary<int, int> dictionary = new(); TreeDictionary<int, int> dictionary = new();
Assert.AreEqual(dictionary.Count, 0); Assert.That(dictionary.Count, Is.EqualTo(0));
dictionary.Add(2, 7); dictionary.Add(2, 7);
dictionary.Add(1, 4); dictionary.Add(1, 4);
@ -22,7 +22,7 @@ namespace Ryujinx.Tests.Collections
dictionary.Add(11, 2); dictionary.Add(11, 2);
dictionary.Add(5, 2); dictionary.Add(5, 2);
Assert.AreEqual(dictionary.Count, 7); Assert.That(dictionary.Count, Is.EqualTo(7));
List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList(); List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList();
@ -36,14 +36,14 @@ namespace Ryujinx.Tests.Collections
* *
*/ */
Assert.AreEqual(list.Count, dictionary.Count); Assert.That(list.Count, Is.EqualTo(dictionary.Count));
Assert.AreEqual(list[0].Key, 2); Assert.That(list[0].Key, Is.EqualTo(2));
Assert.AreEqual(list[1].Key, 1); Assert.That(list[1].Key, Is.EqualTo(1));
Assert.AreEqual(list[2].Key, 4); Assert.That(list[2].Key, Is.EqualTo(4));
Assert.AreEqual(list[3].Key, 3); Assert.That(list[3].Key, Is.EqualTo(3));
Assert.AreEqual(list[4].Key, 10); Assert.That(list[4].Key, Is.EqualTo(10));
Assert.AreEqual(list[5].Key, 5); Assert.That(list[5].Key, Is.EqualTo(5));
Assert.AreEqual(list[6].Key, 11); Assert.That(list[6].Key, Is.EqualTo(11));
} }
[Test] [Test]
@ -51,7 +51,7 @@ namespace Ryujinx.Tests.Collections
{ {
TreeDictionary<int, int> dictionary = new(); TreeDictionary<int, int> dictionary = new();
Assert.AreEqual(dictionary.Count, 0); Assert.That(dictionary.Count, Is.EqualTo(0));
dictionary.Add(2, 7); dictionary.Add(2, 7);
dictionary.Add(1, 4); dictionary.Add(1, 4);
@ -66,7 +66,7 @@ namespace Ryujinx.Tests.Collections
dictionary.Add(13, 2); dictionary.Add(13, 2);
dictionary.Add(24, 2); dictionary.Add(24, 2);
dictionary.Add(6, 2); dictionary.Add(6, 2);
Assert.AreEqual(dictionary.Count, 13); Assert.That(dictionary.Count, Is.EqualTo(13));
List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList(); List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList();
@ -84,20 +84,20 @@ namespace Ryujinx.Tests.Collections
{ {
Console.WriteLine($"{node.Key} -> {node.Value}"); Console.WriteLine($"{node.Key} -> {node.Value}");
} }
Assert.AreEqual(list.Count, dictionary.Count); Assert.That(list.Count, Is.EqualTo(dictionary.Count));
Assert.AreEqual(list[0].Key, 4); Assert.That(list[0].Key, Is.EqualTo(4));
Assert.AreEqual(list[1].Key, 2); Assert.That(list[1].Key, Is.EqualTo(2));
Assert.AreEqual(list[2].Key, 10); Assert.That(list[2].Key, Is.EqualTo(10));
Assert.AreEqual(list[3].Key, 1); Assert.That(list[3].Key, Is.EqualTo(1));
Assert.AreEqual(list[4].Key, 3); Assert.That(list[4].Key, Is.EqualTo(3));
Assert.AreEqual(list[5].Key, 7); Assert.That(list[5].Key, Is.EqualTo(7));
Assert.AreEqual(list[6].Key, 13); Assert.That(list[6].Key, Is.EqualTo(13));
Assert.AreEqual(list[7].Key, 5); Assert.That(list[7].Key, Is.EqualTo(5));
Assert.AreEqual(list[8].Key, 9); Assert.That(list[8].Key, Is.EqualTo(9));
Assert.AreEqual(list[9].Key, 11); Assert.That(list[9].Key, Is.EqualTo(11));
Assert.AreEqual(list[10].Key, 24); Assert.That(list[10].Key, Is.EqualTo(24));
Assert.AreEqual(list[11].Key, 6); Assert.That(list[11].Key, Is.EqualTo(6));
Assert.AreEqual(list[12].Key, 8); Assert.That(list[12].Key, Is.EqualTo(8));
list.Clear(); list.Clear();
@ -118,18 +118,18 @@ namespace Ryujinx.Tests.Collections
{ {
Console.WriteLine($"{node.Key} -> {node.Value}"); Console.WriteLine($"{node.Key} -> {node.Value}");
} }
Assert.AreEqual(list[0].Key, 4); Assert.That(list[0].Key, Is.EqualTo(4));
Assert.AreEqual(list[1].Key, 2); Assert.That(list[1].Key, Is.EqualTo(2));
Assert.AreEqual(list[2].Key, 10); Assert.That(list[2].Key, Is.EqualTo(10));
Assert.AreEqual(list[3].Key, 1); Assert.That(list[3].Key, Is.EqualTo(1));
Assert.AreEqual(list[4].Key, 3); Assert.That(list[4].Key, Is.EqualTo(3));
Assert.AreEqual(list[5].Key, 6); Assert.That(list[5].Key, Is.EqualTo(6));
Assert.AreEqual(list[6].Key, 13); Assert.That(list[6].Key, Is.EqualTo(13));
Assert.AreEqual(list[7].Key, 5); Assert.That(list[7].Key, Is.EqualTo(5));
Assert.AreEqual(list[8].Key, 9); Assert.That(list[8].Key, Is.EqualTo(9));
Assert.AreEqual(list[9].Key, 11); Assert.That(list[9].Key, Is.EqualTo(11));
Assert.AreEqual(list[10].Key, 24); Assert.That(list[10].Key, Is.EqualTo(24));
Assert.AreEqual(list[11].Key, 8); Assert.That(list[11].Key, Is.EqualTo(8));
list.Clear(); list.Clear();
@ -149,17 +149,17 @@ namespace Ryujinx.Tests.Collections
{ {
Console.WriteLine($"{node.Key} -> {node.Value}"); Console.WriteLine($"{node.Key} -> {node.Value}");
} }
Assert.AreEqual(list[0].Key, 4); Assert.That(list[0].Key, Is.EqualTo(4));
Assert.AreEqual(list[1].Key, 2); Assert.That(list[1].Key, Is.EqualTo(2));
Assert.AreEqual(list[2].Key, 9); Assert.That(list[2].Key, Is.EqualTo(9));
Assert.AreEqual(list[3].Key, 1); Assert.That(list[3].Key, Is.EqualTo(1));
Assert.AreEqual(list[4].Key, 3); Assert.That(list[4].Key, Is.EqualTo(3));
Assert.AreEqual(list[5].Key, 6); Assert.That(list[5].Key, Is.EqualTo(6));
Assert.AreEqual(list[6].Key, 13); Assert.That(list[6].Key, Is.EqualTo(13));
Assert.AreEqual(list[7].Key, 5); Assert.That(list[7].Key, Is.EqualTo(5));
Assert.AreEqual(list[8].Key, 8); Assert.That(list[8].Key, Is.EqualTo(8));
Assert.AreEqual(list[9].Key, 11); Assert.That(list[9].Key, Is.EqualTo(11));
Assert.AreEqual(list[10].Key, 24); Assert.That(list[10].Key, Is.EqualTo(24));
} }
[Test] [Test]
@ -167,7 +167,7 @@ namespace Ryujinx.Tests.Collections
{ {
TreeDictionary<int, int> dictionary = new(); TreeDictionary<int, int> dictionary = new();
Assert.AreEqual(dictionary.Count, 0); Assert.That(dictionary.Count, Is.EqualTo(0));
dictionary.Add(2, 7); dictionary.Add(2, 7);
dictionary.Add(1, 4); dictionary.Add(1, 4);
@ -182,7 +182,7 @@ namespace Ryujinx.Tests.Collections
dictionary.Add(13, 2); dictionary.Add(13, 2);
dictionary.Add(24, 2); dictionary.Add(24, 2);
dictionary.Add(6, 2); dictionary.Add(6, 2);
Assert.AreEqual(dictionary.Count, 13); Assert.That(dictionary.Count, Is.EqualTo(13));
List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList(); List<KeyValuePair<int, int>> list = dictionary.AsLevelOrderList();
@ -201,44 +201,44 @@ namespace Ryujinx.Tests.Collections
* 6 8 * 6 8
*/ */
Assert.AreEqual(list.Count, dictionary.Count); Assert.That(list.Count, Is.EqualTo(dictionary.Count));
Assert.AreEqual(list[0].Key, 4); Assert.That(list[0].Key, Is.EqualTo(4));
Assert.AreEqual(list[1].Key, 2); Assert.That(list[1].Key, Is.EqualTo(2));
Assert.AreEqual(list[2].Key, 10); Assert.That(list[2].Key, Is.EqualTo(10));
Assert.AreEqual(list[3].Key, 1); Assert.That(list[3].Key, Is.EqualTo(1));
Assert.AreEqual(list[4].Key, 3); Assert.That(list[4].Key, Is.EqualTo(3));
Assert.AreEqual(list[5].Key, 7); Assert.That(list[5].Key, Is.EqualTo(7));
Assert.AreEqual(list[6].Key, 13); Assert.That(list[6].Key, Is.EqualTo(13));
Assert.AreEqual(list[7].Key, 5); Assert.That(list[7].Key, Is.EqualTo(5));
Assert.AreEqual(list[8].Key, 9); Assert.That(list[8].Key, Is.EqualTo(9));
Assert.AreEqual(list[9].Key, 11); Assert.That(list[9].Key, Is.EqualTo(11));
Assert.AreEqual(list[10].Key, 24); Assert.That(list[10].Key, Is.EqualTo(24));
Assert.AreEqual(list[11].Key, 6); Assert.That(list[11].Key, Is.EqualTo(6));
Assert.AreEqual(list[12].Key, 8); Assert.That(list[12].Key, Is.EqualTo(8));
Assert.AreEqual(list[4].Value, 2); Assert.That(list[4].Value, Is.EqualTo(2));
dictionary.Add(3, 4); dictionary.Add(3, 4);
list = dictionary.AsLevelOrderList(); list = dictionary.AsLevelOrderList();
Assert.AreEqual(list[4].Value, 4); Assert.That(list[4].Value, Is.EqualTo(4));
// Assure that none of the nodes locations have been modified. // Assure that none of the nodes locations have been modified.
Assert.AreEqual(list[0].Key, 4); Assert.That(list[0].Key, Is.EqualTo(4));
Assert.AreEqual(list[1].Key, 2); Assert.That(list[1].Key, Is.EqualTo(2));
Assert.AreEqual(list[2].Key, 10); Assert.That(list[2].Key, Is.EqualTo(10));
Assert.AreEqual(list[3].Key, 1); Assert.That(list[3].Key, Is.EqualTo(1));
Assert.AreEqual(list[4].Key, 3); Assert.That(list[4].Key, Is.EqualTo(3));
Assert.AreEqual(list[5].Key, 7); Assert.That(list[5].Key, Is.EqualTo(7));
Assert.AreEqual(list[6].Key, 13); Assert.That(list[6].Key, Is.EqualTo(13));
Assert.AreEqual(list[7].Key, 5); Assert.That(list[7].Key, Is.EqualTo(5));
Assert.AreEqual(list[8].Key, 9); Assert.That(list[8].Key, Is.EqualTo(9));
Assert.AreEqual(list[9].Key, 11); Assert.That(list[9].Key, Is.EqualTo(11));
Assert.AreEqual(list[10].Key, 24); Assert.That(list[10].Key, Is.EqualTo(24));
Assert.AreEqual(list[11].Key, 6); Assert.That(list[11].Key, Is.EqualTo(6));
Assert.AreEqual(list[12].Key, 8); Assert.That(list[12].Key, Is.EqualTo(8));
} }
} }
} }