diff --git a/test/ObjLoadingTests.lua b/test/ObjLoadingTests.lua index 339ca606..3d315f41 100644 --- a/test/ObjLoadingTests.lua +++ b/test/ObjLoadingTests.lua @@ -3,6 +3,7 @@ ObjLoadingTests = {} function ObjLoadingTests:include(includes) if includes:handle(self:name()) then includedirs { + "%{wks.location}/src/ObjLoading", path.join(TestFolder(), "ObjLoadingTests") } end diff --git a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp new file mode 100644 index 00000000..b2622a73 --- /dev/null +++ b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp @@ -0,0 +1,57 @@ +#include "Game/IW3/Image/ImageLoaderEmbeddedIW3.h" + +#include "Game/IW3/GameIW3.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW3; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderEmbeddedIW3: Can parse dds", "[iw3][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW3/Image/TestImage.dds"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderEmbeddedIW3(memory, searchPath); + auto result = loader->CreateAsset("*testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "*testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + + REQUIRE(image->texture.loadDef); + REQUIRE(image->texture.loadDef->resourceSize > 0); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp new file mode 100644 index 00000000..8673f594 --- /dev/null +++ b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp @@ -0,0 +1,54 @@ +#include "Game/IW3/Image/ImageLoaderExternalIW3.h" + +#include "Game/IW3/GameIW3.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW3; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderExternalIW3: Can parse iwi", "[iw3][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW3/Image/TestImage.iwi"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderExternalIW3(memory, searchPath); + auto result = loader->CreateAsset("testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW3/Image/TestImage.dds b/test/ObjLoadingTests/Game/IW3/Image/TestImage.dds new file mode 100644 index 00000000..8705ec9d Binary files /dev/null and b/test/ObjLoadingTests/Game/IW3/Image/TestImage.dds differ diff --git a/test/ObjLoadingTests/Game/IW3/Image/TestImage.iwi b/test/ObjLoadingTests/Game/IW3/Image/TestImage.iwi new file mode 100644 index 00000000..14294e0c Binary files /dev/null and b/test/ObjLoadingTests/Game/IW3/Image/TestImage.iwi differ diff --git a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp new file mode 100644 index 00000000..cc7c3f46 --- /dev/null +++ b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp @@ -0,0 +1,57 @@ +#include "Game/IW4/Image/ImageLoaderEmbeddedIW4.h" + +#include "Game/IW4/GameIW4.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW4; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderEmbeddedIW4: Can parse dds", "[iw4][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW4/Image/TestImage.dds"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderEmbeddedIW4(memory, searchPath); + auto result = loader->CreateAsset("*testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "*testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + + REQUIRE(image->texture.loadDef); + REQUIRE(image->texture.loadDef->resourceSize > 0); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp new file mode 100644 index 00000000..fcedfe5f --- /dev/null +++ b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp @@ -0,0 +1,54 @@ +#include "Game/IW4/Image/ImageLoaderExternalIW4.h" + +#include "Game/IW4/GameIW4.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW4; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderExternalIW4: Can parse iwi", "[iw4][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW4/Image/TestImage.iwi"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderExternalIW4(memory, searchPath); + auto result = loader->CreateAsset("testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW4/Image/TestImage.dds b/test/ObjLoadingTests/Game/IW4/Image/TestImage.dds new file mode 100644 index 00000000..8705ec9d Binary files /dev/null and b/test/ObjLoadingTests/Game/IW4/Image/TestImage.dds differ diff --git a/test/ObjLoadingTests/Game/IW4/Image/TestImage.iwi b/test/ObjLoadingTests/Game/IW4/Image/TestImage.iwi new file mode 100644 index 00000000..172bde0e Binary files /dev/null and b/test/ObjLoadingTests/Game/IW4/Image/TestImage.iwi differ diff --git a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp new file mode 100644 index 00000000..859478cb --- /dev/null +++ b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp @@ -0,0 +1,57 @@ +#include "Game/IW5/Image/ImageLoaderEmbeddedIW5.h" + +#include "Game/IW5/GameIW5.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW5; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderEmbeddedIW5: Can parse dds", "[iw5][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW5/Image/TestImage.dds"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderEmbeddedIW5(memory, searchPath); + auto result = loader->CreateAsset("*testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "*testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + + REQUIRE(image->texture.loadDef); + REQUIRE(image->texture.loadDef->resourceSize > 0); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp new file mode 100644 index 00000000..02fd3256 --- /dev/null +++ b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp @@ -0,0 +1,54 @@ +#include "Game/IW5/Image/ImageLoaderExternalIW5.h" + +#include "Game/IW5/GameIW5.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace IW5; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderExternalIW5: Can parse iwi", "[iw5][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/IW5/Image/TestImage.iwi"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderExternalIW5(memory, searchPath); + auto result = loader->CreateAsset("testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/IW5/Image/TestImage.dds b/test/ObjLoadingTests/Game/IW5/Image/TestImage.dds new file mode 100644 index 00000000..8705ec9d Binary files /dev/null and b/test/ObjLoadingTests/Game/IW5/Image/TestImage.dds differ diff --git a/test/ObjLoadingTests/Game/IW5/Image/TestImage.iwi b/test/ObjLoadingTests/Game/IW5/Image/TestImage.iwi new file mode 100644 index 00000000..172bde0e Binary files /dev/null and b/test/ObjLoadingTests/Game/IW5/Image/TestImage.iwi differ diff --git a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp new file mode 100644 index 00000000..2a7a9e77 --- /dev/null +++ b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp @@ -0,0 +1,57 @@ +#include "Game/T5/Image/ImageLoaderEmbeddedT5.h" + +#include "Game/T5/GameT5.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace T5; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderEmbeddedT5: Can parse dds", "[t5][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/T5/Image/TestImage.dds"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderEmbeddedT5(memory, searchPath); + auto result = loader->CreateAsset("*testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "*testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + + REQUIRE(image->texture.loadDef); + REQUIRE(image->texture.loadDef->resourceSize > 0); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp new file mode 100644 index 00000000..dea4c70a --- /dev/null +++ b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp @@ -0,0 +1,54 @@ +#include "Game/T5/Image/ImageLoaderExternalT5.h" + +#include "Game/T5/GameT5.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace T5; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderExternalT5: Can parse iwi", "[t5][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/T5/Image/TestImage.iwi"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderExternalT5(memory, searchPath); + auto result = loader->CreateAsset("testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/T5/Image/TestImage.dds b/test/ObjLoadingTests/Game/T5/Image/TestImage.dds new file mode 100644 index 00000000..8705ec9d Binary files /dev/null and b/test/ObjLoadingTests/Game/T5/Image/TestImage.dds differ diff --git a/test/ObjLoadingTests/Game/T5/Image/TestImage.iwi b/test/ObjLoadingTests/Game/T5/Image/TestImage.iwi new file mode 100644 index 00000000..fb909fdb Binary files /dev/null and b/test/ObjLoadingTests/Game/T5/Image/TestImage.iwi differ diff --git a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp new file mode 100644 index 00000000..62aed0db --- /dev/null +++ b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp @@ -0,0 +1,58 @@ +#include "Game/T6/Image/ImageLoaderEmbeddedT6.h" + +#include "Game/T6/GameT6.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace T6; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderEmbeddedT6: Can parse dds", "[t6][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/T6/Image/TestImage.dds"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderEmbeddedT6(memory, searchPath); + auto result = loader->CreateAsset("*testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "*testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + REQUIRE(image->streamedPartCount == 0); + + REQUIRE(image->texture.loadDef); + REQUIRE(image->texture.loadDef->resourceSize > 0); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp new file mode 100644 index 00000000..077aecbe --- /dev/null +++ b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp @@ -0,0 +1,57 @@ +#include "Game/T6/Image/ImageLoaderExternalT6.h" + +#include "Game/T6/GameT6.h" +#include "OatTestPaths.h" +#include "SearchPath/MockSearchPath.h" +#include "Utils/MemoryManager.h" + +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace T6; +using namespace std::literals; + +namespace +{ + TEST_CASE("ImageLoaderExternalT6: Can parse iwi", "[t6][image]") + { + MockSearchPath searchPath; + + const auto filePath = oat::paths::GetTestDirectory() / "ObjLoadingTests/Game/T6/Image/TestImage.iwi"; + const auto fileSize = fs::file_size(filePath); + + std::ifstream file(filePath, std::ios::binary); + REQUIRE(file.is_open()); + + const auto data = std::make_unique(fileSize); + file.read(data.get(), fileSize); + + searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); + + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + + MemoryManager memory; + AssetCreatorCollection creatorCollection(zone); + IgnoredAssetLookup ignoredAssetLookup; + AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); + + auto loader = image::CreateLoaderExternalT6(memory, searchPath); + auto result = loader->CreateAsset("testimage", context); + REQUIRE(result.HasBeenSuccessful()); + + const auto* assetInfo = reinterpret_cast*>(result.GetAssetInfo()); + const auto* image = assetInfo->Asset(); + + REQUIRE(image->name == "testimage"s); + REQUIRE(image->width == 64); + REQUIRE(image->height == 64); + REQUIRE(image->depth == 1); + REQUIRE(image->streamedPartCount == 1); + REQUIRE(image->streamedParts[0].levelSize == 2112); + REQUIRE(image->streamedParts[0].hash == (0x386422F2 & 0x1FFFFFFF)); + } +} // namespace diff --git a/test/ObjLoadingTests/Game/T6/Image/TestImage.dds b/test/ObjLoadingTests/Game/T6/Image/TestImage.dds new file mode 100644 index 00000000..8705ec9d Binary files /dev/null and b/test/ObjLoadingTests/Game/T6/Image/TestImage.dds differ diff --git a/test/ObjLoadingTests/Game/T6/Image/TestImage.iwi b/test/ObjLoadingTests/Game/T6/Image/TestImage.iwi new file mode 100644 index 00000000..43eedd48 Binary files /dev/null and b/test/ObjLoadingTests/Game/T6/Image/TestImage.iwi differ