Skip to content

Commit eb2f4ef

Browse files
fsfodvgvassilev
authored andcommitted
Fix some enum tests for windows where the default enum base type is int
1 parent b043759 commit eb2f4ef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

unittests/CppInterOp/EnumReflectionTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ TEST(EnumReflectionTest, GetIntegerTypeFromEnumScope) {
124124
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[1])), "char");
125125
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[2])), "int");
126126
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[3])), "long long");
127+
#ifdef _WIN32
128+
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[4])),
129+
"int");
130+
#else
127131
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[4])), "unsigned int");
132+
#endif
128133
EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetIntegerTypeFromEnumScope(Decls[5])),"NULL TYPE");
129134
}
130135

@@ -180,7 +185,11 @@ TEST(EnumReflectionTest, GetIntegerTypeFromEnumType) {
180185
EXPECT_EQ(get_int_type_from_enum_var(Decls[7]), "char");
181186
EXPECT_EQ(get_int_type_from_enum_var(Decls[8]), "int");
182187
EXPECT_EQ(get_int_type_from_enum_var(Decls[9]), "long long");
188+
#ifdef _WIN32
189+
EXPECT_EQ(get_int_type_from_enum_var(Decls[10]), "int");
190+
#else
183191
EXPECT_EQ(get_int_type_from_enum_var(Decls[10]), "unsigned int");
192+
#endif
184193
EXPECT_EQ(get_int_type_from_enum_var(Decls[11]), "NULL TYPE"); // When a non Enum Type variable is used
185194
}
186195

0 commit comments

Comments
 (0)