Parse cpp_namespace
This commit is contained in:
parent
ce69b0157f
commit
7e1ef01105
2 changed files with 10 additions and 2 deletions
|
|
@ -41,8 +41,7 @@ namespace c
|
||||||
}
|
}
|
||||||
else if (ns.name() == "d")
|
else if (ns.name() == "d")
|
||||||
{
|
{
|
||||||
REQUIRE(ns.parent());
|
check_parent(ns, "c", "c::d");
|
||||||
REQUIRE(ns.parent().value().name() == "c");
|
|
||||||
REQUIRE(!ns.is_inline());
|
REQUIRE(!ns.is_inline());
|
||||||
REQUIRE(no_children == 0u);
|
REQUIRE(no_children == 0u);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,13 @@ unsigned count_children(const Entity& cont)
|
||||||
return std::distance(cont.begin(), cont.end());
|
return std::distance(cont.begin(), cont.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checks the full name/parent
|
||||||
|
inline void check_parent(const cppast::cpp_entity& e, const char* parent_name,
|
||||||
|
const char* full_name)
|
||||||
|
{
|
||||||
|
REQUIRE(e.parent());
|
||||||
|
REQUIRE(e.parent().value().name() == parent_name);
|
||||||
|
REQUIRE(cppast::full_name(e) == full_name);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // CPPAST_TEST_PARSER_HPP_INCLUDED
|
#endif // CPPAST_TEST_PARSER_HPP_INCLUDED
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue