Run common tests on xts and subdir filesystems

This commit is contained in:
Alex Barney 2020-02-03 00:44:50 -07:00
parent 3139f6900e
commit ac3c496018
2 changed files with 53 additions and 0 deletions

View 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;
}
}
}

View 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;
}
}
}