File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed
Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ namespace Reflect
3737 static TypeInfo GetTypeInfo (void * objectInstance)
3838 {
3939 static_assert (std::is_base_of_v<IReflect, T>);
40- return GetTypeInfo (T::GetTypeId (), objectInstance);
40+ return GetTypeInfo (T::GetStaticTypeInfo (). GetTypeId (), objectInstance);
4141 }
4242
4343 private:
Original file line number Diff line number Diff line change @@ -1415,11 +1415,6 @@ namespace Reflect::Parser
14151415 std::thread thread = std::thread ([&]()
14161416 {
14171417#endif
1418- if (reflectedData.NameWithNamespace == " Insight::Graphics::TextureDrawData_DX12" )
1419- {
1420- int asd = 0 ;
1421- }
1422-
14231418 REFLECT_PROFILE_SCOPE_CSTR (reflectedData.NameWithNamespace .c_str ());
14241419 // Go through all our struct/class inheritance
14251420 for (auto & inheritanceItem : reflectedData.Inheritance )
Original file line number Diff line number Diff line change @@ -125,9 +125,23 @@ TEST_CASE("TypeInfo registry")
125125{
126126 ClassHolder classHolder;
127127 Reflect::TypeInfoRegistry& registy = Reflect::TypeInfoRegistry::Instance ();
128- {
129- Player player;
130- }
128+
129+ Player p;
130+ Reflect::TypeInfo playerTypeInfo = p.GetTypeInfo ();
131+ CHECK (playerTypeInfo.GetType ().IsValid ());
132+
133+ Reflect::Type playerType = Reflect::Type::MakeType<Player>();
134+ CHECK (playerType.IsValid ());
135+ CHECK (playerType == playerTypeInfo.GetType ());
136+ CHECK (playerType.GetTypeId () == playerTypeInfo.GetType ().GetTypeId ());
137+
138+ CHECK (registy.HasTypeInfo (playerType.GetTypeId ()));
139+
140+ Reflect::TypeInfo rPTypeInfo = registy.GetTypeInfo <Player>();
141+ CHECK (!rPTypeInfo.IsValid ());
142+ CHECK (!rPTypeInfo.HasObjectInstance ());
143+ CHECK (rPTypeInfo.GetType () == playerTypeInfo);
144+ CHECK (rPTypeInfo.GetType ().GetTypeId () == playerTypeInfo.GetTypeId ());
131145}
132146
133147TEST_CASE (" Get type info no owner" )
You can’t perform that action at this time.
0 commit comments