Commit f51b59fe authored by ussrhero's avatar ussrhero

added reproduction test for nested enum

parent 32da972c
......@@ -146,6 +146,10 @@ struct structWithNested {
short m_field9;
};
};
enum {
NestConst = 123
};
};
extern structWithNested g_structWithNested;
......
......@@ -519,3 +519,19 @@ TEST_F(ClangTest, MultipleInheritance)
std::wstring str;
EXPECT_NO_THROW(str = typeInfo->str());
}
TEST_F(ClangTest, NestedEnum)
{
static const wchar_t srcCode[] = L"\
struct Test { \
enum { \
VAL = 1 \
}; \
}; \
";
TypeInfoPtr testStruct;
ASSERT_NO_THROW(testStruct = compileType(srcCode, L"Test"));
EXPECT_EQ(1, *testStruct->getElement(L"VAL"));
}
......@@ -719,5 +719,10 @@ TEST_F(TypedVarTest, GetSource)
ASSERT_NO_THROW(funcptr = loadTypedVar(L"classChild::childMethod"));
funcptr->getSourceLine(funcptr->getAddress(), fileName, lineNo);
EXPECT_EQ(278, lineNo);
EXPECT_EQ(282, lineNo);
}
TEST_F(TypedVarTest, StructNestedEnum)
{
EXPECT_EQ(g_structWithNested.NestConst, *loadTypedVar(L"g_structWithNested")->getElement(L"NestConst"));
}
......@@ -631,3 +631,8 @@ TEST_F(TypeInfoTest, TemplateStruct)
EXPECT_EQ(L"TemplateStruct<TemplateStruct<int> [4]>", loadType(L"TemplateStruct<TemplateStruct<int> [4]>")->getName());
}
TEST_F(TypeInfoTest, StructNestedEnum)
{
EXPECT_EQ(structWithNested::NestConst, *loadType(L"structWithNested")->getElement(L"NestConst"));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment