lib.cpp 1.1 KB

123456789101112131415161718192021222324252627
  1. #include <entt/entity/registry.hpp>
  2. #include <gtest/gtest.h>
  3. extern typename entt::registry<>::component_type a_module_int_type();
  4. extern typename entt::registry<>::component_type a_module_char_type();
  5. extern typename entt::registry<>::component_type another_module_int_type();
  6. extern typename entt::registry<>::component_type another_module_char_type();
  7. ENTT_SHARED_TYPE(int);
  8. ENTT_SHARED_TYPE(char);
  9. TEST(Lib, Shared) {
  10. entt::registry<> registry;
  11. ASSERT_EQ(registry.type<int>(), registry.type<const int>());
  12. ASSERT_EQ(registry.type<char>(), registry.type<const char>());
  13. ASSERT_EQ(registry.type<int>(), a_module_int_type());
  14. ASSERT_EQ(registry.type<char>(), a_module_char_type());
  15. ASSERT_EQ(registry.type<const int>(), a_module_int_type());
  16. ASSERT_EQ(registry.type<const char>(), a_module_char_type());
  17. ASSERT_EQ(registry.type<const char>(), another_module_char_type());
  18. ASSERT_EQ(registry.type<const int>(), another_module_int_type());
  19. ASSERT_EQ(registry.type<char>(), another_module_char_type());
  20. ASSERT_EQ(registry.type<int>(), another_module_int_type());
  21. }