diff options
| author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-25 18:37:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-25 18:37:53 +0200 |
| commit | 2b2ce68f07041189977515aa5b6ff6f04477d386 (patch) | |
| tree | a692804e91b81e9194b5fb930e6a271f9375e4a6 /src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs | |
| parent | bc53d0046310293a90a4312fa9317bb698dded5c (diff) | |
[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>
Diffstat (limited to 'src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs')
| -rw-r--r-- | src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs b/src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs index 674d2356..dffbe74d 100644 --- a/src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs +++ b/src/Ryujinx.Tests.Memory/MultiRegionTrackingTests.cs @@ -9,8 +9,6 @@ namespace Ryujinx.Tests.Memory { public class MultiRegionTrackingTests { - private const int RndCnt = 3; - private const ulong MemorySize = 0x8000; private const int PageSize = 4096; @@ -39,7 +37,7 @@ namespace Ryujinx.Tests.Memory (IMultiRegionHandle)_tracking.BeginGranularTracking(address, size, null, granularity, 0); } - private void RandomOrder(Random random, List<int> indices, Action<int> action) + private static void RandomOrder(Random random, List<int> indices, Action<int> action) { List<int> choices = indices.ToList(); @@ -51,7 +49,7 @@ namespace Ryujinx.Tests.Memory } } - private int ExpectQueryInOrder(IMultiRegionHandle handle, ulong startAddress, ulong size, Func<ulong, bool> addressPredicate) + private static int ExpectQueryInOrder(IMultiRegionHandle handle, ulong startAddress, ulong size, Func<ulong, bool> addressPredicate) { int regionCount = 0; ulong lastAddress = startAddress; @@ -67,7 +65,7 @@ namespace Ryujinx.Tests.Memory return regionCount; } - private int ExpectQueryInOrder(IMultiRegionHandle handle, ulong startAddress, ulong size, Func<ulong, bool> addressPredicate, int sequenceNumber) + private static int ExpectQueryInOrder(IMultiRegionHandle handle, ulong startAddress, ulong size, Func<ulong, bool> addressPredicate, int sequenceNumber) { int regionCount = 0; ulong lastAddress = startAddress; @@ -83,9 +81,9 @@ namespace Ryujinx.Tests.Memory return regionCount; } - private void PreparePages(IMultiRegionHandle handle, int pageCount, ulong address = 0) + private static void PreparePages(IMultiRegionHandle handle, int pageCount, ulong address = 0) { - Random random = new Random(); + Random random = new(); // Make sure the list has minimum granularity (smart region changes granularity based on requested ranges) RandomOrder(random, Enumerable.Range(0, pageCount).ToList(), (i) => @@ -105,7 +103,7 @@ namespace Ryujinx.Tests.Memory const int pageCount = 32; IMultiRegionHandle handle = GetGranular(smart, 0, PageSize * pageCount, PageSize); - Random random = new Random(); + Random random = new(); PreparePages(handle, pageCount); @@ -149,7 +147,7 @@ namespace Ryujinx.Tests.Memory PreparePages(handle, pageCount); - Random random = new Random(); + Random random = new(); IEnumerable<int> halfRange = Enumerable.Range(0, pageCount / 2); List<int> odd = halfRange.Select(x => x * 2 + 1).ToList(); @@ -240,7 +238,8 @@ namespace Ryujinx.Tests.Memory ulong expectedAddress = 0; // Expect each region to trigger in its entirety, in address ascending order. - handle.QueryModified((address, size) => { + handle.QueryModified((address, size) => + { int region = regionSizes[regionInd++]; Assert.AreEqual(address, expectedAddress); @@ -437,4 +436,4 @@ namespace Ryujinx.Tests.Memory Assert.AreEqual(pagesModified, new bool[] { true, false, false }); } } -}
\ No newline at end of file +} |
