fix time tests

pull/135/head
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";
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;
}
}
}
}

View File

@ -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);
}
}