forked from qt-creator/qt-creator
TestResult: Change semantic for createIntermediateResultFor
Don't pass the other test result into createIntermediateResultFor(). Rename it to createIntermediateResult() and create a new result based on this object. Fix the caller so that it calls createIntermediateResult() for previously passed "other". Change-Id: I2c87cee1daa4f400c867852d071bd5c91b84dfd5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -175,15 +175,14 @@ bool TestResult::isIntermediateFor(const TestResult *other) const
|
||||
return !m_id.isEmpty() && m_id == other->m_id && m_name == other->m_name;
|
||||
}
|
||||
|
||||
TestResult *TestResult::createIntermediateResultFor(const TestResult *other) const
|
||||
TestResult *TestResult::createIntermediateResult() const
|
||||
{
|
||||
QTC_ASSERT(other, return nullptr);
|
||||
if (other->m_hooks.createResult) {
|
||||
if (m_hooks.createResult) {
|
||||
TestResult *newResult = new TestResult;
|
||||
*newResult = other->m_hooks.createResult(*other);
|
||||
*newResult = m_hooks.createResult(*this);
|
||||
return newResult;
|
||||
}
|
||||
TestResult *intermediate = new TestResult(other->m_id, other->m_name);
|
||||
TestResult *intermediate = new TestResult(m_id, m_name);
|
||||
return intermediate;
|
||||
}
|
||||
|
||||
|
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
bool isDirectParentOf(const TestResult *other, bool *needsIntermediate) const;
|
||||
bool isIntermediateFor(const TestResult *other) const;
|
||||
TestResult *createIntermediateResultFor(const TestResult *other) const;
|
||||
TestResult *createIntermediateResult() const;
|
||||
|
||||
private:
|
||||
QString m_id;
|
||||
|
@@ -179,7 +179,7 @@ TestResultItem *TestResultItem::intermediateFor(const TestResultItem *item) cons
|
||||
|
||||
TestResultItem *TestResultItem::createAndAddIntermediateFor(const TestResultItem *child)
|
||||
{
|
||||
TestResultPtr result(m_testResult->createIntermediateResultFor(child->testResult()));
|
||||
TestResultPtr result(child->testResult()->createIntermediateResult());
|
||||
QTC_ASSERT(!result.isNull(), return nullptr);
|
||||
result->setResult(ResultType::TestStart);
|
||||
TestResultItem *intermediate = new TestResultItem(result);
|
||||
|
Reference in New Issue
Block a user