mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: don't call OsLibrary::load directly, use function pointer
this allows mocking this call in ULT Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
006285105d
commit
579af57161
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -264,7 +264,7 @@ int NlApi::nlaNestEnd(struct nl_msg *msg, struct nlattr *attr) {
|
||||
}
|
||||
|
||||
NlApi::NlApi() {
|
||||
genlLibraryHandle.reset(NEO::OsLibrary::load(std::string(libgenlFile)));
|
||||
genlLibraryHandle.reset(NEO::OsLibrary::loadFunc(std::string(libgenlFile)));
|
||||
}
|
||||
|
||||
NlApi::~NlApi() = default;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -79,7 +79,7 @@ UdevLibImp::~UdevLibImp(){};
|
||||
UdevLib *UdevLib::create() {
|
||||
UdevLibImp *pUdevLib = new UdevLibImp();
|
||||
UNRECOVERABLE_IF(nullptr == pUdevLib);
|
||||
pUdevLib->libraryHandle.reset(NEO::OsLibrary::load(std::string(libUdevlFile)));
|
||||
pUdevLib->libraryHandle.reset(NEO::OsLibrary::loadFunc(std::string(libUdevlFile)));
|
||||
if (pUdevLib->libraryHandle == nullptr || pUdevLib->loadEntryPoints() == false || !pUdevLib->init()) {
|
||||
delete pUdevLib;
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user