mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-03 13:27:11 +02:00
[Ryujinx.Tests.Memory] Address dotnet-format issues (#5390)
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Address dotnet format CA1822 warnings * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * Final dotnet format pass and fix naming rule violations * Apply suggestions from code review Co-authored-by: Ac_K <Acoustik666@gmail.com> * Remove unused constant --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
This commit is contained in:
parent
bc53d00463
commit
2b2ce68f07
3 changed files with 37 additions and 36 deletions
|
@ -7,14 +7,14 @@ namespace Ryujinx.Tests.Memory
|
|||
{
|
||||
public class Tests
|
||||
{
|
||||
private static readonly ulong MemorySize = MemoryBlock.GetPageSize() * 8;
|
||||
private static readonly ulong _memorySize = MemoryBlock.GetPageSize() * 8;
|
||||
|
||||
private MemoryBlock _memoryBlock;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_memoryBlock = new MemoryBlock(MemorySize);
|
||||
_memoryBlock = new MemoryBlock(_memorySize);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
@ -47,8 +47,8 @@ namespace Ryujinx.Tests.Memory
|
|||
ulong pageSize = MemoryBlock.GetPageSize();
|
||||
ulong blockSize = MemoryBlock.GetPageSize() * 16;
|
||||
|
||||
using MemoryBlock backing = new MemoryBlock(blockSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new MemoryBlock(blockSize, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
using MemoryBlock backing = new(blockSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new(blockSize, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
|
||||
toAlias.MapView(backing, pageSize, 0, pageSize * 4);
|
||||
toAlias.UnmapView(backing, pageSize * 3, pageSize);
|
||||
|
@ -66,10 +66,10 @@ namespace Ryujinx.Tests.Memory
|
|||
int pageBits = (int)ulong.Log2(pageSize);
|
||||
ulong blockSize = MemoryBlock.GetPageSize() * 128;
|
||||
|
||||
using MemoryBlock backing = new MemoryBlock(blockSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new MemoryBlock(blockSize, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
using MemoryBlock backing = new(blockSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new(blockSize, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
|
||||
Random rng = new Random(123);
|
||||
Random rng = new(123);
|
||||
|
||||
for (int i = 0; i < 20000; i++)
|
||||
{
|
||||
|
@ -101,8 +101,8 @@ namespace Ryujinx.Tests.Memory
|
|||
ulong pageSize = MemoryBlock.GetPageSize();
|
||||
ulong size = 100000 * pageSize; // The mappings limit on Linux is usually around 65K, so let's make sure we are above that.
|
||||
|
||||
using MemoryBlock backing = new MemoryBlock(pageSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new MemoryBlock(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
using MemoryBlock backing = new(pageSize, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
|
||||
for (ulong offset = 0; offset < size; offset += pageSize)
|
||||
{
|
||||
|
@ -115,4 +115,4 @@ namespace Ryujinx.Tests.Memory
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue