Add missing ULTs for driverHandleImp

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2021-07-01 08:29:41 +00:00
committed by Compute-Runtime-Automation
parent 232640afc3
commit 484dea027c
2 changed files with 14 additions and 1 deletions

View File

@@ -235,7 +235,7 @@ ze_result_t DriverHandleImp::getDevice(uint32_t *pCount, ze_device_handle_t *phD
}
if (phDevices == nullptr) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
return ZE_RESULT_ERROR_INVALID_NULL_HANDLE;
}
for (uint32_t i = 0; i < *pCount; i++) {

View File

@@ -460,6 +460,19 @@ TEST_F(DriverHandleTest, givenInitializedDriverWhenGetDeviceIsCalledThenOneDevic
EXPECT_NE(nullptr, &device);
}
TEST_F(DriverHandleTest, whenQueryingForApiVersionThenExpectedVersionIsReturned) {
ze_api_version_t version = {};
ze_result_t result = driverHandle->getApiVersion(&version);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(ZE_API_VERSION_1_1, version);
}
TEST_F(DriverHandleTest, whenQueryingForDevicesWithCountGreaterThanZeroAndNullDevicePointerThenNullHandleIsReturned) {
uint32_t count = 1;
ze_result_t result = driverHandle->getDevice(&count, nullptr);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_NULL_HANDLE, result);
}
TEST_F(DriverHandleTest, givenValidDriverHandleWhenGetSvmAllocManagerIsCalledThenSvmAllocsManagerIsObtained) {
auto svmAllocsManager = driverHandle->getSvmAllocsManager();
EXPECT_NE(nullptr, svmAllocsManager);