2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-12-27 12:31:50 +00:00

chore: add simple system tests for remaining games

This commit is contained in:
Jan Laupetin
2025-12-23 16:26:40 +01:00
parent e675b001f7
commit 0fe942b80d
13 changed files with 285 additions and 0 deletions

View File

@@ -1,12 +1,16 @@
#include "Game/IW3/GameAssetPoolIW3.h"
#include "Linker.h"
#include "OatTestPaths.h"
#include "SystemTestsPaths.h"
#include "ZoneLoading.h"
#include <catch2/catch_test_macros.hpp>
#include <filesystem>
#include <format>
#include <memory>
#include <string>
namespace fs = std::filesystem;
using namespace std::literals;
namespace
@@ -41,5 +45,18 @@ namespace
const auto linkerResult = linker->Start();
REQUIRE(linkerResult);
const auto expectedZonePath = (fs::path(outputPath) / "SimpleZoneIW3.ff").string();
auto maybeZone = ZoneLoading::LoadZone(expectedZonePath, std::nullopt);
REQUIRE(maybeZone);
auto zone = std::move(*maybeZone);
auto pools = dynamic_cast<GameAssetPoolIW3*>(zone->m_pools.get());
REQUIRE(zone->m_game_id == GameId::IW3);
REQUIRE(zone->m_platform == GamePlatform::PC);
REQUIRE(zone->m_name == "SimpleZoneIW3");
REQUIRE(pools->GetTotalAssetCount() == 1);
REQUIRE(pools->m_raw_file->GetAsset("SimpleZone.txt"));
}
} // namespace