From 61c50e4aa343387b56192a34db6384d1dfcfa3c5 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 5 Feb 2015 13:32:00 +0100 Subject: [PATCH] Fix wrong behavior for gathering test configuration If the current project mixed named and unnamed Quick tests determing the test configuration failed due to running into the assert if you had no auto tests for the current project selected as well. Change-Id: I5c98316fada704cd7e021becab897d168a19b99b Reviewed-by: Andre Poenitz --- plugins/autotest/testtreemodel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp index 81e4d4bfc92..9c8d235a04b 100644 --- a/plugins/autotest/testtreemodel.cpp +++ b/plugins/autotest/testtreemodel.cpp @@ -464,13 +464,13 @@ QList TestTreeModel::getSelectedTests() const QTC_ASSERT(testConfiguration, qWarning() << "Illegal state (unnamed Quick Test listed as named)"; return QList()); - foundMains[mainFile]->setTestCaseCount(testConfiguration->testCaseCount()); + foundMains[mainFile]->setTestCaseCount(testConfiguration->testCaseCount() + 1); } else { - TestConfiguration *tc = new TestConfiguration(QString(), QStringList()); - tc->setTestCaseCount(1); - tc->setUnnamedOnly(true); - addProjectInformation(tc, mainFile); - foundMains.insert(mainFile, tc); + testConfiguration = new TestConfiguration(QString(), QStringList()); + testConfiguration->setTestCaseCount(1); + testConfiguration->setUnnamedOnly(true); + addProjectInformation(testConfiguration, mainFile); + foundMains.insert(mainFile, testConfiguration); } } }