forked from qt-creator/qt-creator
TestResult: Devirtualize the class - part 5 of 5
Step 5 - implement createResultHook. Change-Id: Ibe81fb93c8c1c12d1af458d0f9707d02864febd8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -178,6 +178,11 @@ bool TestResult::isIntermediateFor(const TestResult *other) const
|
||||
TestResult *TestResult::createIntermediateResultFor(const TestResult *other) const
|
||||
{
|
||||
QTC_ASSERT(other, return nullptr);
|
||||
if (other->m_hooks.createResult) {
|
||||
TestResult *newResult = new TestResult;
|
||||
*newResult = other->m_hooks.createResult(*other);
|
||||
return newResult;
|
||||
}
|
||||
TestResult *intermediate = new TestResult(other->m_id, other->m_name);
|
||||
return intermediate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user