mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Run common tests on xts and subdir filesystems
This commit is contained in:
parent
3139f6900e
commit
ac3c496018
2 changed files with 53 additions and 0 deletions
19
tests/LibHac.Tests/Fs/AesXtsFileSystemTests.cs
Normal file
19
tests/LibHac.Tests/Fs/AesXtsFileSystemTests.cs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
using LibHac.Tests.Fs.IFileSystemTestBase;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.Fs
|
||||||
|
{
|
||||||
|
public class AesXtsFileSystemTests : IFileSystemTests
|
||||||
|
{
|
||||||
|
protected override IFileSystem CreateFileSystem()
|
||||||
|
{
|
||||||
|
var baseFs = new InMemoryFileSystem();
|
||||||
|
|
||||||
|
var keys = new byte[0x20];
|
||||||
|
var xtsFs = new AesXtsFileSystem(baseFs, keys, 0x4000);
|
||||||
|
|
||||||
|
return xtsFs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
tests/LibHac.Tests/Fs/SubdirectoryFileSystemTests.cs
Normal file
34
tests/LibHac.Tests/Fs/SubdirectoryFileSystemTests.cs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
using System.Diagnostics;
|
||||||
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
using LibHac.Tests.Fs.IFileSystemTestBase;
|
||||||
|
|
||||||
|
namespace LibHac.Tests.Fs
|
||||||
|
{
|
||||||
|
public class SubdirectoryFileSystemTests : IFileSystemTests
|
||||||
|
{
|
||||||
|
protected override IFileSystem CreateFileSystem()
|
||||||
|
{
|
||||||
|
Trace.Listeners.Clear();
|
||||||
|
var baseFs = new InMemoryFileSystem();
|
||||||
|
baseFs.CreateDirectory("/sub");
|
||||||
|
baseFs.CreateDirectory("/sub/path");
|
||||||
|
|
||||||
|
var subFs = new SubdirectoryFileSystem(baseFs, "/sub/path");
|
||||||
|
|
||||||
|
return subFs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class SubdirectoryFileSystemTestsRoot : IFileSystemTests
|
||||||
|
{
|
||||||
|
protected override IFileSystem CreateFileSystem()
|
||||||
|
{
|
||||||
|
Trace.Listeners.Clear();
|
||||||
|
var baseFs = new InMemoryFileSystem();
|
||||||
|
|
||||||
|
var subFs = new SubdirectoryFileSystem(baseFs, "/");
|
||||||
|
|
||||||
|
return subFs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue