fix time tests

This commit is contained in:
Simon Stürz 2016-04-19 10:48:04 +02:00 committed by Michael Zanetti
parent bc611ca8aa
commit d4f2d9fc8e
2 changed files with 6 additions and 4 deletions

View File

@ -101,15 +101,15 @@ void HttpDaemon::readClient()
qCDebug(dcMockDevice) << "Clear action history"; qCDebug(dcMockDevice) << "Clear action history";
m_actionList.clear(); m_actionList.clear();
} }
if (tokens[0] == "GET") { if (tokens[0] == "GET") {
QTextStream os(socket); QTextStream os(socket);
os.setAutoDetectUnicode(true); os.setAutoDetectUnicode(true);
os << generateWebPage(); os << generateWebPage();
socket->close(); socket->close();
if (socket->state() == QTcpSocket::UnconnectedState) { if (socket->state() == QTcpSocket::UnconnectedState)
delete socket; delete socket;
}
} }
} }
} }

View File

@ -500,12 +500,14 @@ void TestTimeManager::testCalendarItemHourly()
GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 10))); GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 10)));
verifyRuleExecuted(mockActionIdWithParams); verifyRuleExecuted(mockActionIdWithParams);
cleanupMockHistory(); cleanupMockHistory();
cleanupMockHistory();
// inactive unchanged // inactive unchanged
GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 11))); GuhCore::instance()->timeManager()->setTime(QDateTime(currentDateTime.date(), QTime(future.time().hour(), 11)));
verifyRuleNotExecuted(); verifyRuleNotExecuted();
// One hour "Back to the future" // 'i' hours "Back to the future"
future = future.addSecs(3*60*60); future = future.addSecs(i*60*60);
} }
} }