storage_utility.cpp 1.4 KB

1234567891011121314151617181920212223242526272829
  1. #include <gtest/gtest.h>
  2. #include <entt/entity/storage.hpp>
  3. template<typename Type>
  4. struct StorageUtility: testing::Test {
  5. using type = Type;
  6. };
  7. using StorageUtilityTypes = ::testing::Types<int, char, double, void>;
  8. TYPED_TEST_SUITE(StorageUtility, StorageUtilityTypes, );
  9. TYPED_TEST(StorageUtility, StorageType) {
  10. using value_type = typename TestFixture::type;
  11. // just a bunch of static asserts to avoid regressions
  12. testing::StaticAssertTypeEq<entt::storage_type_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
  13. testing::StaticAssertTypeEq<entt::storage_type_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
  14. }
  15. TYPED_TEST(StorageUtility, StorageFor) {
  16. using value_type = typename TestFixture::type;
  17. // just a bunch of static asserts to avoid regressions
  18. testing::StaticAssertTypeEq<entt::storage_for_t<const value_type, entt::entity>, const entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
  19. testing::StaticAssertTypeEq<entt::storage_for_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
  20. testing::StaticAssertTypeEq<entt::storage_for_t<const value_type>, const entt::sigh_mixin<entt::storage<value_type>>>();
  21. testing::StaticAssertTypeEq<entt::storage_for_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
  22. }