mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
make polymorphic component storage type
This commit is contained in:
@@ -6,4 +6,5 @@ include(GoogleTest)
|
||||
|
||||
# Add the subdirectories
|
||||
add_subdirectory(dCommonTests)
|
||||
add_subdirectory(dECSTests)
|
||||
add_subdirectory(dGameTests)
|
||||
|
9
tests/dECSTests/CMakeLists.txt
Normal file
9
tests/dECSTests/CMakeLists.txt
Normal 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)
|
10
tests/dECSTests/TestECS.cpp
Normal file
10
tests/dECSTests/TestECS.cpp
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user