test(Resources): Add Texture and Mesh tests (8 test cases)
This commit is contained in:
33
tests/Resources/test_mesh.cpp
Normal file
33
tests/Resources/test_mesh.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <XCEngine/Resources/Mesh.h>
|
||||
#include <XCEngine/Resources/ResourceTypes.h>
|
||||
#include <XCEngine/Resources/ResourceManager.h>
|
||||
|
||||
using namespace XCEngine::Resources;
|
||||
|
||||
namespace {
|
||||
|
||||
TEST(Mesh, DefaultConstructor) {
|
||||
Mesh mesh;
|
||||
EXPECT_EQ(mesh.GetVertexCount(), 0u);
|
||||
EXPECT_EQ(mesh.GetIndexCount(), 0u);
|
||||
EXPECT_EQ(mesh.GetVertexStride(), 0u);
|
||||
EXPECT_FALSE(mesh.IsUse32BitIndex());
|
||||
}
|
||||
|
||||
TEST(Mesh, GetType) {
|
||||
Mesh mesh;
|
||||
EXPECT_EQ(mesh.GetType(), ResourceType::Mesh);
|
||||
}
|
||||
|
||||
TEST(Mesh, GetMemorySize) {
|
||||
Mesh mesh;
|
||||
EXPECT_EQ(mesh.GetMemorySize(), 0u);
|
||||
}
|
||||
|
||||
TEST(Mesh, GetSections) {
|
||||
Mesh mesh;
|
||||
EXPECT_EQ(mesh.GetSections().Size(), 0u);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
37
tests/Resources/test_texture.cpp
Normal file
37
tests/Resources/test_texture.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <XCEngine/Resources/Texture.h>
|
||||
#include <XCEngine/Resources/ResourceTypes.h>
|
||||
#include <XCEngine/Resources/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
|
||||
Reference in New Issue
Block a user