forked from qt-creator/qt-creator
AutoTest: Guard against nullptr access
Change-Id: I15e5d769b7a4b30421f52fbbe380ca7f19214b42 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -216,7 +216,8 @@ void TestRunner::scheduleNext()
|
|||||||
void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
|
void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
|
||||||
{
|
{
|
||||||
if (reason == UserCanceled) {
|
if (reason == UserCanceled) {
|
||||||
if (!m_fakeFutureInterface->isCanceled()) // depends on using the button / progress bar
|
// when using the stop button we need to report, for progress bar this happens automatically
|
||||||
|
if (m_fakeFutureInterface && !m_fakeFutureInterface->isCanceled())
|
||||||
m_fakeFutureInterface->reportCanceled();
|
m_fakeFutureInterface->reportCanceled();
|
||||||
}
|
}
|
||||||
if (m_currentProcess && m_currentProcess->state() != QProcess::NotRunning) {
|
if (m_currentProcess && m_currentProcess->state() != QProcess::NotRunning) {
|
||||||
@@ -231,6 +232,7 @@ void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
|
|||||||
|
|
||||||
void TestRunner::onProcessFinished()
|
void TestRunner::onProcessFinished()
|
||||||
{
|
{
|
||||||
|
if (m_currentConfig) {
|
||||||
m_fakeFutureInterface->setProgressValue(m_fakeFutureInterface->progressValue()
|
m_fakeFutureInterface->setProgressValue(m_fakeFutureInterface->progressValue()
|
||||||
+ m_currentConfig->testCaseCount());
|
+ m_currentConfig->testCaseCount());
|
||||||
if (!m_fakeFutureInterface->isCanceled()) {
|
if (!m_fakeFutureInterface->isCanceled()) {
|
||||||
@@ -246,7 +248,7 @@ void TestRunner::onProcessFinished()
|
|||||||
+ rcInfo(m_currentConfig))));
|
+ rcInfo(m_currentConfig))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
resetInternalPointers();
|
resetInternalPointers();
|
||||||
|
|
||||||
if (!m_selectedTests.isEmpty() && !m_fakeFutureInterface->isCanceled())
|
if (!m_selectedTests.isEmpty() && !m_fakeFutureInterface->isCanceled())
|
||||||
|
Reference in New Issue
Block a user