mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
27 lines
696 B
C#
27 lines
696 B
C#
using LibHac.Common;
|
|
using LibHac.Fs;
|
|
using LibHac.Fs.Fsa;
|
|
using Xunit;
|
|
|
|
namespace LibHac.Tests.Fs.IFileSystemTestBase;
|
|
|
|
public abstract partial class IFileSystemTests
|
|
{
|
|
[Fact]
|
|
public void SetSize_FileSizeModified()
|
|
{
|
|
IFileSystem fs = CreateFileSystem();
|
|
fs.CreateFile("/file", 0, CreateFileOptions.None);
|
|
|
|
using var file = new UniqueRef<IFile>();
|
|
fs.OpenFile(ref file.Ref(), "/file", OpenMode.All);
|
|
Result rc = file.Get.SetSize(54321);
|
|
file.Reset();
|
|
|
|
fs.OpenFile(ref file.Ref(), "/file", OpenMode.All);
|
|
file.Get.GetSize(out long fileSize);
|
|
|
|
Assert.Success(rc);
|
|
Assert.Equal(54321, fileSize);
|
|
}
|
|
}
|