Skip to content

Commit

Permalink
Corrected condition to allow both CL_INVALID_PROPERTY and CL_INVALID_…
Browse files Browse the repository at this point in the history
…VALUE in overlapping cases
  • Loading branch information
shajder committed Jul 4, 2024
1 parent e8c34d6 commit 62d8f49
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,15 @@ struct CreateInvalidProperty : public SemaphoreTestBase

semaphore =
clCreateSemaphoreWithPropertiesKHR(context, sema_props, &err);
test_failure_error(
err, CL_INVALID_PROPERTY,
"Unexpected clCreateSemaphoreWithPropertiesKHR return");

if (err != CL_INVALID_PROPERTY && err != CL_INVALID_VALUE)
{
log_error("Unexpected clCreateSemaphoreWithPropertiesKHR "
"result, expected "
"CL_INVALID_PROPERTY or CL_INVALID_VALUE, got %s\n",
IGetErrorString(err));
return TEST_FAIL;
}
}

// 2) Value specified for a supported property name is not valid
Expand All @@ -108,9 +114,15 @@ struct CreateInvalidProperty : public SemaphoreTestBase

semaphore =
clCreateSemaphoreWithPropertiesKHR(context, sema_props, &err);
test_failure_error(
err, CL_INVALID_PROPERTY,
"Unexpected clCreateSemaphoreWithPropertiesKHR return");

if (err != CL_INVALID_PROPERTY && err != CL_INVALID_VALUE)
{
log_error("Unexpected clCreateSemaphoreWithPropertiesKHR "
"result, expected "
"CL_INVALID_PROPERTY or CL_INVALID_VALUE, got %s\n",
IGetErrorString(err));
return TEST_FAIL;
}
}

// 3) The same property name is specified more than once
Expand All @@ -128,7 +140,7 @@ struct CreateInvalidProperty : public SemaphoreTestBase
"Unexpected clCreateSemaphoreWithPropertiesKHR return");
}

return CL_SUCCESS;
return TEST_PASS;
}
};

Expand Down

0 comments on commit 62d8f49

Please sign in to comment.