refactor(tests): reorganize tests directory to match engine structure

- Created tests/Core/Asset/ with tests for IResource, ResourceTypes, ResourceHandle, ResourceCache, ResourceDependencyGraph, ResourceGUID
- Created tests/Core/IO/ with tests for IResourceLoader, ResourcePath, ResourceFileSystem, FileArchive, ResourcePackage
- Reorganized tests/Resources/ into subdirectories: Texture/, Mesh/, Material/, Shader/, AudioClip/
- Added CMakeLists.txt for each new test subdirectory
- Fixed Material.h missing ResourceManager.h include (lost during engine refactor)
- tests/Core/CMakeLists.txt updated to include Asset/ and IO/ subdirectories
This commit is contained in:
2026-03-24 15:44:13 +08:00
parent 0345ce50cf
commit 0b3423966d
25 changed files with 999 additions and 59 deletions

View File

@@ -0,0 +1,37 @@
#include <gtest/gtest.h>
#include <XCEngine/Resources/Texture/Texture.h>
#include <XCEngine/Core/Asset/ResourceTypes.h>
#include <XCEngine/Core/Asset/ResourceManager.h>
using namespace XCEngine::Resources;
namespace {
TEST(Texture, DefaultConstructor) {
Texture texture;
EXPECT_EQ(texture.GetWidth(), 0u);
EXPECT_EQ(texture.GetHeight(), 0u);
EXPECT_EQ(texture.GetDepth(), 1u);
EXPECT_EQ(texture.GetMipLevels(), 1u);
EXPECT_EQ(texture.GetArraySize(), 1u);
EXPECT_EQ(texture.GetTextureType(), TextureType::Texture2D);
EXPECT_EQ(texture.GetFormat(), TextureFormat::RGBA8_UNORM);
EXPECT_EQ(texture.GetUsage(), TextureUsage::ShaderResource);
}
TEST(Texture, GetMemorySize) {
Texture texture;
EXPECT_EQ(texture.GetMemorySize(), 0u);
}
TEST(Texture, GetType) {
Texture texture;
EXPECT_EQ(texture.GetType(), ResourceType::Texture);
}
TEST(Texture, IsValid) {
Texture texture;
EXPECT_FALSE(texture.IsValid());
}
} // namespace