forked from qt-creator/qt-creator
AutoTest: Fix handling of forward declared test classes
If a class has been forward declared we might not end up inside the real class declaration when trying to find declared test functions. So, do not just take the first found symbol into account, continue to process others if we haven't found the real declaration. Task-number: QTCREATORBUG-19319 Change-Id: I752d7a10470f5362e2214596966d93c037d58f4a Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -148,8 +148,8 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
||||
}
|
||||
}
|
||||
|
||||
if (lookupItems.size()) {
|
||||
if (CPlusPlus::Symbol *symbol = lookupItems.first().declaration()) {
|
||||
for (const CPlusPlus::LookupItem &item : lookupItems) {
|
||||
if (CPlusPlus::Symbol *symbol = item.declaration()) {
|
||||
if (CPlusPlus::Class *toeClass = symbol->asClass()) {
|
||||
const QString declFileName = QLatin1String(toeClass->fileId()->chars(),
|
||||
toeClass->fileId()->size());
|
||||
|
Reference in New Issue
Block a user