Commit af784481 authored by ussrhero's avatar ussrhero

added test for ambigious class memebers

parent 4154e469
......@@ -15,7 +15,13 @@ const TypeFieldPtr& FieldCollection::lookup(const std::wstring &name) const
FieldList::const_iterator it;
for (it = m_fields.begin(); it != m_fields.end(); ++it)
{
if ( (*it)->getName() == name )
if ( !(*it)->isInheritedMember() && (*it)->getName() == name)
return *it;
}
for (it = m_fields.begin(); it != m_fields.end(); ++it)
{
if ( (*it)->isInheritedMember() && (*it)->getName() == name )
return *it;
}
......
......@@ -221,6 +221,13 @@ TEST_F( TypedVarTest, DISABLED_StaticMember )
EXPECT_EQ( g_classChild.m_staticConst, *var->getElement(L"m_staticConst") );
}
TEST_F(TypedVarTest, AmbiguiousFields)
{
TypedVarPtr var;
ASSERT_NO_THROW(var = loadTypedVar(L"g_virtChild"));
EXPECT_EQ(g_virtChild.m_member, *var->getElement(L"m_member"));
}
TEST_F( TypedVarTest, VirtualMember )
{
......
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