chore(file): add tests for SFile functions

This commit is contained in:
Adam Heinermann 2026-01-15 19:24:18 -08:00 committed by fallenoak
parent 1e86f98691
commit 40d58978e1
20 changed files with 567 additions and 18 deletions

29
test/FileTest.hpp Normal file
View file

@ -0,0 +1,29 @@
#include "Test.hpp"
#include "storm/Error.hpp"
#include "storm/File.hpp"
#include <string>
struct OpenFileTestCase {
std::string info;
HSARCHIVE (*OpenArchiveFn)();
uint32_t flags;
};
struct ReadFileTestCase {
std::string info;
HSFILE (*OpenFileFn)();
uint32_t eofcode;
};
HSARCHIVE OpenNullArchive();
HSARCHIVE OpenTestArchive();
HSFILE ReadTestFileFromDisk();
HSFILE ReadTestFileFromMpq();
extern OpenFileTestCase OpenFromDiskCase;
extern OpenFileTestCase OpenFromMPQCase;
extern ReadFileTestCase ReadFromDiskCase;
extern ReadFileTestCase ReadFromMPQCase;