Crusader_Decomp/rebuild/remorse/tests/glob_archive_tests.cpp

28 lines
774 B
C++
Raw Normal View History

#include "remorse/file_system.h"
#include "remorse/glob_archive.h"
#include <cassert>
#include <filesystem>
int main()
{
const auto root = remorse::findGameDataRoot(std::filesystem::current_path());
assert(root.has_value());
const auto globPath = remorse::resolveGameDataPath(*root, std::filesystem::path("STATIC") / "GLOB.FLX");
assert(globPath.has_value());
const auto objects = remorse::loadGlobObjects(*globPath);
assert(objects.has_value());
assert(!objects->empty());
bool foundObjectWithEntries = false;
for (const remorse::GlobObject& object : *objects) {
if (!object.entries.empty()) {
foundObjectWithEntries = true;
break;
}
}
assert(foundObjectWithEntries);
return 0;
}