chore: fix test compilation

This commit is contained in:
Jan
2024-12-31 12:38:22 +01:00
parent 83d13aa166
commit 692c31b711
8 changed files with 60 additions and 148 deletions

View File

@ -1,7 +1,6 @@
#include "Game/IW5/AssetLoaders/AssetLoaderStringTable.h"
#include "Game/IW5/StringTable/LoaderStringTableIW5.h"
#include "Game/IW5/GameIW5.h"
#include "Mock/MockAssetLoadingManager.h"
#include "Mock/MockSearchPath.h"
#include "Utils/MemoryManager.h"
@ -21,17 +20,19 @@ namespace
"lorem,ipsum");
Zone zone("MockZone", 0, IGame::GetGameById(GameId::IW5));
MockAssetLoadingManager assetLoadingManager(zone, searchPath);
AssetLoaderStringTable assetLoader;
MemoryManager memory;
AssetCreatorCollection creatorCollection(zone);
IgnoredAssetLookup ignoredAssetLookup;
AssetCreationContext context(&zone, &creatorCollection, &ignoredAssetLookup);
assetLoader.LoadFromRaw("mp/cooltable.csv", &searchPath, &memory, &assetLoadingManager, &zone);
auto* assetInfo = reinterpret_cast<XAssetInfo<StringTable>*>(assetLoadingManager.MockGetAddedAsset("mp/cooltable.csv"));
REQUIRE(assetInfo != nullptr);
auto loader = CreateStringTableLoader(memory, searchPath);
auto result = loader->CreateAsset("mp/cooltable.csv", context);
REQUIRE(result.HasBeenSuccessful());
const auto* assetInfo = reinterpret_cast<XAssetInfo<StringTable>*>(result.GetAssetInfo());
const auto* stringTable = assetInfo->Asset();
REQUIRE(stringTable->name == "mp/cooltable.csv"s);
REQUIRE(stringTable->columnCount == 3);
REQUIRE(stringTable->rowCount == 2);