Skip to content

Commit cc43cd6

Browse files
committed
Removed debug code. Updated test code
1 parent fb3bb7c commit cc43cd6

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Reflect/inc/Reflect/Structs/TypeInfoRegistry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

Reflect/src/Reflect/FileParser/FileParser.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff 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)

ReflectTest/src/main.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff 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

133147
TEST_CASE("Get type info no owner")

0 commit comments

Comments
 (0)