LibHac/tests/LibHac.Tests/Fs/IFileSystemTestBase/IFileSystemTests.IFile.Size.cs
2020-06-09 22:55:59 -07:00

28 lines
No EOL
770 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".ToU8Span(), 0, CreateFileOptions.None);
fs.OpenFile(out IFile file, "/file".ToU8Span(), OpenMode.All);
Result rc = file.SetSize(54321);
file.Dispose();
fs.OpenFile(out file, "/file".ToU8Span(), OpenMode.All);
file.GetSize(out long fileSize);
file.Dispose();
Assert.True(rc.IsSuccess());
Assert.Equal(54321, fileSize);
}
}
}