make polymorphic component storage type

This commit is contained in:
jadebenn
2024-12-14 13:47:35 -06:00
parent 34618607c3
commit afc2966507
7 changed files with 98 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
add_executable(dECSTests
"TestECS.cpp"
)
# Link needed libraries
target_link_libraries(dECSTests PRIVATE dCommon dECS GTest::gtest_main)
# Discover the tests
gtest_discover_tests(dECSTests)

View File

@@ -0,0 +1,10 @@
#include <gtest/gtest.h>
#include "ECS.h"
TEST(ECSTest, MakeStorage) {
const auto storage = Component::Storage<Component::Pet>();
const Component::IStorage* const storagePtr = &storage;
ASSERT_EQ(storagePtr->GetKind(), Component::Kind::PET);
ASSERT_NE(storagePtr->GetKind(), Component::Kind::DESTROYABLE);
}