2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "runtime/os_interface/linux/os_interface.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/os_interface/linux/os_time_linux.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
class MockOSTimeLinux : public OSTimeLinux {
|
|
|
|
public:
|
|
|
|
MockOSTimeLinux(OSInterface *osInterface) : OSTimeLinux(osInterface){};
|
|
|
|
void setResolutionFunc(resolutionFunc_t func) {
|
|
|
|
this->resolutionFunc = func;
|
|
|
|
}
|
|
|
|
void setGetTimeFunc(getTimeFunc_t func) {
|
|
|
|
this->getTimeFunc = func;
|
|
|
|
}
|
|
|
|
void updateDrm(Drm *drm) {
|
|
|
|
osInterface->get()->setDrm(drm);
|
|
|
|
pDrm = drm;
|
|
|
|
timestampTypeDetect();
|
|
|
|
}
|
|
|
|
static std::unique_ptr<MockOSTimeLinux> create(OSInterface *osInterface) {
|
|
|
|
return std::unique_ptr<MockOSTimeLinux>(new MockOSTimeLinux(osInterface));
|
|
|
|
}
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|