mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
refactor: Handle dlopen error
Related-To: NEO-13922 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
28c008e438
commit
42261526e4
@@ -143,11 +143,20 @@ TEST(OSContextLinux, givenPerContextVmsAndBindCompleteWhenGetFenceAddressAndValT
|
||||
EXPECT_GT(fenceValToWait, 0u);
|
||||
}
|
||||
|
||||
extern void *(*dlopenFunc)(const char *filename, int flags);
|
||||
|
||||
TEST(OSContextLinux, WhenCreateOsContextLinuxThenCheckIfOVLoaded) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
drm.requirePerContextVM = true;
|
||||
|
||||
{
|
||||
VariableBackup<decltype(dlopenFunc)> mockOpen(&dlopenFunc, [](const char *pathname, int flags) -> void * {
|
||||
return nullptr;
|
||||
});
|
||||
MockOsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
EXPECT_FALSE(osContext.ovLoaded);
|
||||
}
|
||||
{
|
||||
VariableBackup<decltype(SysCalls::sysCallsDlinfo)> mockDlinfo(&SysCalls::sysCallsDlinfo, [](void *handle, int request, void *info) -> int {
|
||||
return -2;
|
||||
|
||||
Reference in New Issue
Block a user