data: Renamed Global to GlobalVariable in Graph

This commit is contained in:
Eberhard Graether
2014-07-01 11:13:27 +02:00
parent cf6d17584f
commit b72584559c
5 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ void Storage::onGlobalVariableParsed(const ParseLocation& location, const ParseV
log("global", variable.fullName, location);
Node* node = m_graph.createNodeHierarchy(variable.fullName);
node->setType(Node::NODE_GLOBAL);
node->setType(Node::NODE_GLOBAL_VARIABLE);
node->setConst(variable.isConst);
node->setStatic(variable.isStatic);
+3 -3
View File
@@ -163,7 +163,7 @@ bool Node::isConst() const
void Node::setConst(bool isConst)
{
if (isConst && m_type != NODE_GLOBAL && m_type != NODE_FIELD && m_type != NODE_METHOD)
if (isConst && m_type != NODE_GLOBAL_VARIABLE && m_type != NODE_FIELD && m_type != NODE_METHOD)
{
LOG_ERROR("Setting const on wrong node of type " + getTypeString(m_type));
return;
@@ -179,7 +179,7 @@ bool Node::isStatic() const
void Node::setStatic(bool isStatic)
{
if (isStatic && m_type != NODE_GLOBAL && m_type != NODE_FIELD && m_type != NODE_METHOD)
if (isStatic && m_type != NODE_GLOBAL_VARIABLE && m_type != NODE_FIELD && m_type != NODE_METHOD)
{
LOG_ERROR("Setting static on wrong node of type " + getTypeString(m_type));
return;
@@ -198,7 +198,7 @@ std::string Node::getTypeString(NodeType type) const
return "class";
case NODE_STRUCT:
return "struct";
case NODE_GLOBAL:
case NODE_GLOBAL_VARIABLE:
return "global";
case NODE_FIELD:
return "field";
+1 -1
View File
@@ -17,7 +17,7 @@ public:
NODE_UNDEFINED,
NODE_CLASS,
NODE_STRUCT,
NODE_GLOBAL,
NODE_GLOBAL_VARIABLE,
NODE_FIELD,
NODE_FUNCTION,
NODE_METHOD,
+9 -9
View File
@@ -148,9 +148,9 @@ public:
parser.parseFile(TextAccess::createFromString(text));
TS_ASSERT_EQUALS(client->globals.size(), 2);
TS_ASSERT_EQUALS(client->globals[0], "int x <1:1 1:5>");
TS_ASSERT_EQUALS(client->globals[1], "A * b <3:1 3:4>");
TS_ASSERT_EQUALS(client->globalVariables.size(), 2);
TS_ASSERT_EQUALS(client->globalVariables[0], "int x <1:1 1:5>");
TS_ASSERT_EQUALS(client->globalVariables[1], "A * b <3:1 3:4>");
}
void test_cxx_parser_finds_variable_definitions_in_namespace_scope()
@@ -167,9 +167,9 @@ public:
parser.parseFile(TextAccess::createFromString(text));
TS_ASSERT_EQUALS(client->globals.size(), 2);
TS_ASSERT_EQUALS(client->globals[0], "int n::x <2:2 2:6>");
TS_ASSERT_EQUALS(client->globals[1], "n::A * n::b <4:2 4:5>");
TS_ASSERT_EQUALS(client->globalVariables.size(), 2);
TS_ASSERT_EQUALS(client->globalVariables[0], "int n::x <2:2 2:6>");
TS_ASSERT_EQUALS(client->globalVariables[1], "n::A * n::b <4:2 4:5>");
}
void test_cxx_parser_finds_field_in_nested_class()
@@ -493,7 +493,7 @@ public:
TS_ASSERT_EQUALS(client->enumFields.size(), 2);
TS_ASSERT_EQUALS(client->functions.size(), 2);
TS_ASSERT_EQUALS(client->fields.size(), 4);
TS_ASSERT_EQUALS(client->globals.size(), 2);
TS_ASSERT_EQUALS(client->globalVariables.size(), 2);
TS_ASSERT_EQUALS(client->methods.size(), 5);
TS_ASSERT_EQUALS(client->namespaces.size(), 2);
TS_ASSERT_EQUALS(client->structs.size(), 1);
@@ -524,7 +524,7 @@ private:
virtual void onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable)
{
globals.push_back(addLocationSuffix(variableStr(variable), location));
globalVariables.push_back(addLocationSuffix(variableStr(variable), location));
}
virtual void onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access)
@@ -575,7 +575,7 @@ private:
std::vector<std::string> enumFields;
std::vector<std::string> functions;
std::vector<std::string> fields;
std::vector<std::string> globals;
std::vector<std::string> globalVariables;
std::vector<std::string> methods;
std::vector<std::string> namespaces;
std::vector<std::string> structs;
+1 -1
View File
@@ -36,7 +36,7 @@ public:
void test_get_and_set_const_and_static_of_nodes()
{
Node n(Node::NODE_GLOBAL, "A");
Node n(Node::NODE_GLOBAL_VARIABLE, "A");
TS_ASSERT(!n.isConst());
TS_ASSERT(!n.isStatic());