fix time tests
This commit is contained in:
parent
bc611ca8aa
commit
d4f2d9fc8e
@ -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;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user