mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Fixup BufferedStorage
This commit is contained in:
parent
f1105da2cc
commit
d2d73827ba
2 changed files with 397 additions and 383 deletions
File diff suppressed because it is too large
Load diff
|
@ -18,10 +18,10 @@ public class BufferedStorageTests
|
||||||
Assert.Success(bufferManager.Initialize(5, buffer, 0x4000, workBuffer));
|
Assert.Success(bufferManager.Initialize(5, buffer, 0x4000, workBuffer));
|
||||||
|
|
||||||
byte[] storageBuffer = new byte[0x80000];
|
byte[] storageBuffer = new byte[0x80000];
|
||||||
var baseStorage = new SubStorage(new MemoryStorage(storageBuffer), 0, storageBuffer.Length);
|
using var baseStorage = new ValueSubStorage(new MemoryStorage(storageBuffer), 0, storageBuffer.Length);
|
||||||
|
|
||||||
var bufferedStorage = new BufferedStorage();
|
var bufferedStorage = new BufferedStorage();
|
||||||
Assert.Success(bufferedStorage.Initialize(baseStorage, bufferManager, 0x4000, 4));
|
Assert.Success(bufferedStorage.Initialize(in baseStorage, bufferManager, 0x4000, 4));
|
||||||
|
|
||||||
byte[] writeBuffer = new byte[0x400];
|
byte[] writeBuffer = new byte[0x400];
|
||||||
byte[] readBuffer = new byte[0x400];
|
byte[] readBuffer = new byte[0x400];
|
||||||
|
@ -196,10 +196,10 @@ public class BufferedStorageTests
|
||||||
byte[] bufferedStorageArray = new byte[config.StorageSize];
|
byte[] bufferedStorageArray = new byte[config.StorageSize];
|
||||||
|
|
||||||
var memoryStorage = new MemoryStorage(memoryStorageArray);
|
var memoryStorage = new MemoryStorage(memoryStorageArray);
|
||||||
var baseBufferedStorage = new SubStorage(new MemoryStorage(bufferedStorageArray), 0, bufferedStorageArray.Length);
|
using var baseBufferedStorage = new ValueSubStorage(new MemoryStorage(bufferedStorageArray), 0, bufferedStorageArray.Length);
|
||||||
|
|
||||||
var bufferedStorage = new BufferedStorage();
|
var bufferedStorage = new BufferedStorage();
|
||||||
Assert.Success(bufferedStorage.Initialize(baseBufferedStorage, bufferManager, config.BlockSize, config.StorageCacheCount));
|
Assert.Success(bufferedStorage.Initialize(in baseBufferedStorage, bufferManager, config.BlockSize, config.StorageCacheCount));
|
||||||
|
|
||||||
if (config.EnableBulkRead)
|
if (config.EnableBulkRead)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue