Skip to content

Commit

Permalink
test: ENTT_NO_MIXIN
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed May 10, 2024
1 parent 8efe02f commit 9edeb73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ SETUP_BASIC_TEST(storage entt/entity/storage.cpp)
SETUP_BASIC_TEST(storage_entity entt/entity/storage_entity.cpp)
SETUP_BASIC_TEST(storage_no_instance entt/entity/storage_no_instance.cpp)
SETUP_BASIC_TEST(storage_utility entt/entity/storage_utility.cpp)
SETUP_BASIC_TEST(storage_utility_no_mixin entt/entity/storage_utility.cpp ENTT_NO_MIXIN)
SETUP_BASIC_TEST(table entt/entity/table.cpp)
SETUP_BASIC_TEST(view entt/entity/view.cpp)

Expand Down
12 changes: 12 additions & 0 deletions test/entt/entity/storage_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@ TYPED_TEST(StorageUtility, StorageType) {
using value_type = typename TestFixture::type;

// just a bunch of static asserts to avoid regressions
#ifdef ENTT_NO_MIXIN
testing::StaticAssertTypeEq<entt::storage_type_t<value_type, entt::entity>, entt::basic_storage<value_type, entt::entity>>();
testing::StaticAssertTypeEq<entt::storage_type_t<value_type>, entt::storage<value_type>>();
#else
testing::StaticAssertTypeEq<entt::storage_type_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
testing::StaticAssertTypeEq<entt::storage_type_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
#endif // ENTT_NO_MIXIN
}

TYPED_TEST(StorageUtility, StorageFor) {
using value_type = typename TestFixture::type;

// just a bunch of static asserts to avoid regressions
#ifdef ENTT_NO_MIXIN
testing::StaticAssertTypeEq<entt::storage_for_t<const value_type, entt::entity>, const entt::basic_storage<value_type, entt::entity>>();
testing::StaticAssertTypeEq<entt::storage_for_t<value_type, entt::entity>, entt::basic_storage<value_type, entt::entity>>();
testing::StaticAssertTypeEq<entt::storage_for_t<const value_type>, const entt::storage<value_type>>();
testing::StaticAssertTypeEq<entt::storage_for_t<value_type>, entt::storage<value_type>>();
#else
testing::StaticAssertTypeEq<entt::storage_for_t<const value_type, entt::entity>, const entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
testing::StaticAssertTypeEq<entt::storage_for_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
testing::StaticAssertTypeEq<entt::storage_for_t<const value_type>, const entt::sigh_mixin<entt::storage<value_type>>>();
testing::StaticAssertTypeEq<entt::storage_for_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
#endif
}

0 comments on commit 9edeb73

Please sign in to comment.