forked from qt-creator/qt-creator
AutoTest: Fix flakyness of plugin test
Relying on the order of tests of the underlying tree model is bad as we order the model for the user with a QSortFilterProxyModel. Using non-unique keys is not wise either. Ensure the keys are unique to have reliable results. Change-Id: I556371d018c16e7b03a8ec85d60afc850056a94a Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -615,13 +615,13 @@ int TestTreeModel::boostTestNamesCount() const
|
||||
return rootNode ? rootNode->childCount() : 0;
|
||||
}
|
||||
|
||||
QMultiMap<QString, int> TestTreeModel::boostTestSuitesAndTests() const
|
||||
QMap<QString, int> TestTreeModel::boostTestSuitesAndTests() const
|
||||
{
|
||||
QMultiMap<QString, int> result;
|
||||
QMap<QString, int> result;
|
||||
|
||||
if (TestTreeItem *rootNode = boostTestRootNode()) {
|
||||
rootNode->forFirstLevelChildren([&result](TestTreeItem *child) {
|
||||
result.insert(child->name(), child->childCount());
|
||||
result.insert(child->name() + '|' + child->proFile(), child->childCount());
|
||||
});
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user