data: Saving virtual abstraction of methods as TokenComponentAbstraction
This commit is contained in:
@@ -258,6 +258,20 @@ public:
|
||||
TS_ASSERT_EQUALS(client->methods[1], "public void B::B() <6:1 <6:4 6:4> 8:1>");
|
||||
}
|
||||
|
||||
void test_cxx_parser_finds_virtual_method()
|
||||
{
|
||||
std::shared_ptr<TestParserClient> client = parseCode(
|
||||
"class B\n"
|
||||
"{\n"
|
||||
"public:\n"
|
||||
" virtual void process();\n"
|
||||
"};\n"
|
||||
);
|
||||
|
||||
TS_ASSERT_EQUALS(client->methods.size(), 1);
|
||||
TS_ASSERT_EQUALS(client->methods[0], "public virtual void B::process() <4:15 4:21>");
|
||||
}
|
||||
|
||||
void test_cxx_parser_finds_pure_virtual_method()
|
||||
{
|
||||
std::shared_ptr<TestParserClient> client = parseCode(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "cxxtest/TestSuite.h"
|
||||
|
||||
#include "data/graph/token_component/TokenComponentAbstraction.h"
|
||||
#include "data/graph/token_component/TokenComponentAccess.h"
|
||||
#include "data/graph/token_component/TokenComponentSignature.h"
|
||||
#include "data/graph/token_component/TokenComponentStatic.h"
|
||||
@@ -257,6 +258,12 @@ public:
|
||||
TS_ASSERT_EQUALS(node->getFullName(), "Class::isMethod");
|
||||
TS_ASSERT_EQUALS(node->getType(), Node::NODE_METHOD);
|
||||
|
||||
TS_ASSERT(node->getComponent<TokenComponentAbstraction>());
|
||||
TS_ASSERT_EQUALS(
|
||||
node->getComponent<TokenComponentAbstraction>()->getAbstraction(),
|
||||
TokenComponentAbstraction::ABSTRACTION_VIRTUAL
|
||||
);
|
||||
|
||||
Edge* memberEdge = node->getMemberEdge();
|
||||
TS_ASSERT(memberEdge);
|
||||
TS_ASSERT_EQUALS(memberEdge->getType(), Edge::EDGE_MEMBER);
|
||||
|
||||
Reference in New Issue
Block a user