logic: add filename info to static global variables (issue #514)

This commit is contained in:
mlangkabel
2017-11-09 17:29:59 +01:00
parent ead9f9a634
commit e7f9940582
14 changed files with 168 additions and 98 deletions
+33
View File
@@ -54,6 +54,39 @@ public:
///////////////////////////////////////////////////////////////////////////////
// test finding symbol definitions and declarations
void test_cxx_parser_finds_global_variable_declaration()
{
std::shared_ptr<TestParserClient> client = parseCode(
"int x;\n"
);
TS_ASSERT(utility::containsElement<std::string>(
client->globalVariables, "int x <1:5 1:5>"
));
}
void test_cxx_parser_finds_static_global_variable_declaration()
{
std::shared_ptr<TestParserClient> client = parseCode(
"static int x;\n"
);
TS_ASSERT(utility::containsElement<std::string>(
client->globalVariables, "int x (input.cc) <1:12 1:12>"
));
}
void test_cxx_parser_finds_static_const_global_variable_declaration()
{
std::shared_ptr<TestParserClient> client = parseCode(
"static const int x;\n"
);
TS_ASSERT(utility::containsElement<std::string>(
client->globalVariables, "const int x (input.cc) <1:18 1:18>"
));
}
void test_cxx_parser_finds_global_class_definition()
{
std::shared_ptr<TestParserClient> client = parseCode(