diff --git a/plugins/deviceplugins/mock/httpdaemon.cpp b/plugins/deviceplugins/mock/httpdaemon.cpp index 61840174..5a1e428c 100644 --- a/plugins/deviceplugins/mock/httpdaemon.cpp +++ b/plugins/deviceplugins/mock/httpdaemon.cpp @@ -101,15 +101,15 @@ void HttpDaemon::readClient() qCDebug(dcMockDevice) << "Clear action history"; m_actionList.clear(); } + if (tokens[0] == "GET") { QTextStream os(socket); os.setAutoDetectUnicode(true); os << generateWebPage(); socket->close(); - if (socket->state() == QTcpSocket::UnconnectedState) { + if (socket->state() == QTcpSocket::UnconnectedState) delete socket; - } } } } diff --git a/tests/auto/timemanager/testtimemanager.cpp b/tests/auto/timemanager/testtimemanager.cpp index deca0ac3..5f6c00d6 100644 --- a/tests/auto/timemanager/testtimemanager.cpp +++ b/tests/auto/timemanager/testtimemanager.cpp @@ -500,12 +500,14 @@ void TestTimeManager::testCalendarItemHourly() GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 10))); verifyRuleExecuted(mockActionIdWithParams); cleanupMockHistory(); + cleanupMockHistory(); + // inactive unchanged GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 11))); verifyRuleNotExecuted(); - // One hour "Back to the future" - future = future.addSecs(3*60*60); + // 'i' hours "Back to the future" + future = future.addSecs(i*60*60); } }