2021-08-10 23:44:58 +02:00
|
|
|
|
using LibHac.Common;
|
|
|
|
|
using LibHac.Fs;
|
2020-06-10 07:55:59 +02:00
|
|
|
|
using LibHac.Fs.Fsa;
|
2020-01-28 08:55:39 +01:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace LibHac.Tests.Fs.IFileSystemTestBase
|
|
|
|
|
{
|
|
|
|
|
public abstract partial class IFileSystemTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void SetSize_FileSizeModified()
|
|
|
|
|
{
|
|
|
|
|
IFileSystem fs = CreateFileSystem();
|
2021-07-19 22:16:11 +02:00
|
|
|
|
fs.CreateFile("/file", 0, CreateFileOptions.None);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
|
2021-08-10 23:44:58 +02:00
|
|
|
|
using var file = new UniqueRef<IFile>();
|
|
|
|
|
fs.OpenFile(ref file.Ref(), "/file", OpenMode.All);
|
|
|
|
|
Result rc = file.Get.SetSize(54321);
|
|
|
|
|
file.Reset();
|
2020-01-28 08:55:39 +01:00
|
|
|
|
|
2021-08-10 23:44:58 +02:00
|
|
|
|
fs.OpenFile(ref file.Ref(), "/file", OpenMode.All);
|
|
|
|
|
file.Get.GetSize(out long fileSize);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
|
2020-07-06 17:37:34 +02:00
|
|
|
|
Assert.Success(rc);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
Assert.Equal(54321, fileSize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|