Version 17 plus test updates and OPK v17
This is the first public release of OPK v17. See the file CHANGELOG.md for details.
This commit is contained in:
@@ -58,6 +58,21 @@ void TestSleep::SyncFakeClock() {
|
||||
Sleep(0);
|
||||
}
|
||||
|
||||
void TestSleep::SetFakeClock(int64_t time_seconds) {
|
||||
if (real_sleep_) {
|
||||
LOGE("SetFakeClock when using a real clock. Expect other failures.");
|
||||
}
|
||||
// Delta could be positive or negative. If the fake clock had been initialized
|
||||
// by the current time on a real clock, and then the command line
|
||||
// re-initializes it to 0, then delta is negative.
|
||||
int64_t delta = time_seconds - Clock().GetCurrentTime();
|
||||
if (callback_ != nullptr) {
|
||||
callback_->ElapseTime(delta * 1000);
|
||||
} else {
|
||||
LOGE("Setting fake clock with no callback. This won't work.");
|
||||
}
|
||||
}
|
||||
|
||||
bool TestSleep::RollbackSystemTime(int seconds) {
|
||||
if (real_sleep_) {
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user