CppTools: Tests: Fix leaking IAssistProposal and SymbolSearcher

Change-Id: Ic81a5df88d17375cf0087213d84443845bfd38cc
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-09-19 12:32:43 +02:00
parent fdc982358e
commit af34a5b9b4
4 changed files with 37 additions and 8 deletions

View File

@@ -106,10 +106,10 @@ public:
m_modelManager->setIndexingSupport(m_indexingSupportToUse);
CppIndexingSupport *indexingSupport = m_modelManager->indexingSupport();
SymbolSearcher *symbolSearcher = indexingSupport->createSymbolSearcher(searchParameters,
QSet<QString>() << testFile);
const QScopedPointer<SymbolSearcher> symbolSearcher(
indexingSupport->createSymbolSearcher(searchParameters, QSet<QString>() << testFile));
QFuture<Core::SearchResultItem> search
= QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher);
= QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher.data());
search.waitForFinished();
ResultDataList results = ResultData::fromSearchResultList(search.results());
QCOMPARE(results, expectedResults);