Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
kdlibcpp
kdlibcpp
Commits
af784481
Commit
af784481
authored
May 27, 2020
by
ussrhero
Browse files
added test for ambigious class memebers
parent
4154e469
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
kdlib/source/udtfiled.cpp
kdlib/source/udtfiled.cpp
+7
-1
kdlib/tests/kdlibtest/typedvartest.cpp
kdlib/tests/kdlibtest/typedvartest.cpp
+7
-0
No files found.
kdlib/source/udtfiled.cpp
View file @
af784481
...
...
@@ -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
;
}
...
...
kdlib/tests/kdlibtest/typedvartest.cpp
View file @
af784481
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment