2020-03-08 09:00:02 +01: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();
|
2020-03-08 09:00:02 +01:00
|
|
|
|
fs.CreateFile("/file".ToU8Span(), 0, CreateFileOptions.None);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
|
2020-03-08 09:00:02 +01:00
|
|
|
|
fs.OpenFile(out IFile file, "/file".ToU8Span(), OpenMode.All);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
Result rc = file.SetSize(54321);
|
|
|
|
|
file.Dispose();
|
|
|
|
|
|
2020-03-08 09:00:02 +01:00
|
|
|
|
fs.OpenFile(out file, "/file".ToU8Span(), OpenMode.All);
|
2020-01-28 08:55:39 +01:00
|
|
|
|
file.GetSize(out long fileSize);
|
|
|
|
|
file.Dispose();
|
|
|
|
|
|
|
|
|
|
Assert.True(rc.IsSuccess());
|
|
|
|
|
Assert.Equal(54321, fileSize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|