forked from qt-creator/qt-creator
Fix support for data tags
Functions defined within the declaration or inside a namespace had no qualified name stored by the visitor. This lead to ignoring them when creating the respective TestTreeItem. Change-Id: Id57c0c492a0cba460aa2d47dc7283bb1ac6e4aa6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -177,15 +177,14 @@ bool TestDataFunctionVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
|
||||
{
|
||||
if (ast->declarator) {
|
||||
CPlusPlus::DeclaratorIdAST *id = ast->declarator->core_declarator->asDeclaratorId();
|
||||
if (!id)
|
||||
if (!id || !ast->symbol || ast->symbol->argumentCount() != 0)
|
||||
return false;
|
||||
|
||||
const QString prettyName = m_overview.prettyName(id->name->name);
|
||||
CPlusPlus::LookupContext lc;
|
||||
const QString prettyName = m_overview.prettyName(lc.fullyQualifiedName(ast->symbol));
|
||||
// do not handle functions that aren't real test data functions
|
||||
if (!prettyName.endsWith(QLatin1String("_data")) || !ast->symbol
|
||||
|| ast->symbol->argumentCount() != 0) {
|
||||
if (!prettyName.endsWith(QLatin1String("_data")))
|
||||
return false;
|
||||
}
|
||||
|
||||
m_currentFunction = prettyName.left(prettyName.size() - 5);
|
||||
m_currentTags.clear();
|
||||
|
Reference in New Issue
Block a user