data: Added getName() method to Edge

format = EdgeType:fromNode->toNode
This commit is contained in:
Eberhard Graether
2014-07-27 02:22:45 +02:00
parent 473e26f072
commit b0e3cda41e
5 changed files with 56 additions and 17 deletions
+19
View File
@@ -360,6 +360,25 @@ public:
TS_ASSERT_DIFFERS(x, b);
}
void test_node_has_name_and_full_name()
{
TestGraph graph;
Node* n = graph.createNodeHierarchy("A::B::C");
TS_ASSERT_EQUALS(n->getName(), "C");
TS_ASSERT_EQUALS(n->getFullName(), "A::B::C");
}
void test_edge_has_name()
{
TestGraph graph;
Node* a = graph.createNodeHierarchy(Node::NODE_FUNCTION, "A");
Node* b = graph.createNodeHierarchy(Node::NODE_FUNCTION, "B");
Edge* e = graph.createEdge(Edge::EDGE_CALL, a, b);
TS_ASSERT_EQUALS(e->getName(), "call:A->B");
}
void test_graph_saves_nodes_with_distinct_signatures()
{
TestGraph graph;