mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Correct GetPlatformIDs error when platform fails to initialize
Change-Id: Icb25cd2924aa406c08af9d47a1002ba6d23724f7 Signed-off-by: Adam Cetnerowski <adam.cetnerowski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
9e9e7ab61f
commit
eb3e6efaf1
@ -78,7 +78,7 @@ cl_int CL_API_CALL clGetPlatformIDs(cl_uint numEntries,
|
||||
bool ret = pPlatform->initialize();
|
||||
DEBUG_BREAK_IF(ret != true);
|
||||
if (!ret) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
retVal = CL_OUT_OF_HOST_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ TEST_F(clGetPlatformIDsTests, GivenNumEntriesZeroAndPlatformNotNullWhenGettingPl
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
|
||||
TEST(clGetPlatformIDsNegativeTests, GivenFailedInitWhenGettingPlatformIdsThenClInvalidValueErrorIsReturned) {
|
||||
TEST(clGetPlatformIDsNegativeTests, GivenFailedInitializationWhenGettingPlatformIdsThenClOutOfHostMemoryErrorIsReturned) {
|
||||
VariableBackup<decltype(getDevicesResult)> bkp(&getDevicesResult, false);
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
@ -58,7 +58,7 @@ TEST(clGetPlatformIDsNegativeTests, GivenFailedInitWhenGettingPlatformIdsThenClI
|
||||
|
||||
retVal = clGetPlatformIDs(1, &platformRet, &numPlatforms);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal);
|
||||
EXPECT_EQ(0u, numPlatforms);
|
||||
EXPECT_EQ(nullptr, platformRet);
|
||||
|
||||
|
Reference in New Issue
Block a user