mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Implement negative tests for cl_device_id API functions (#2495)
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com> Co-authored-by: Chetankumar Mistry <chetan.mistry@arm.com>
This commit is contained in:
@@ -40,9 +40,20 @@ REGISTER_TEST(negative_get_platform_info)
|
||||
{
|
||||
cl_platform_id platform = getPlatformFromDevice(device);
|
||||
|
||||
cl_int err(CL_SUCCESS);
|
||||
for (auto invalid_platform : get_invalid_objects<cl_platform_id>(device))
|
||||
{
|
||||
err = clGetPlatformInfo(invalid_platform, CL_PLATFORM_VERSION,
|
||||
sizeof(char*), nullptr, nullptr);
|
||||
test_failure_error_ret(err, CL_INVALID_PLATFORM,
|
||||
"clGetPlatformInfo should return "
|
||||
"CL_INVALID_PLATFORM when: \"platform "
|
||||
"is not a valid platform\"",
|
||||
TEST_FAIL);
|
||||
}
|
||||
|
||||
constexpr cl_platform_info INVALID_PARAM_VALUE = 0;
|
||||
cl_int err =
|
||||
clGetPlatformInfo(platform, INVALID_PARAM_VALUE, 0, nullptr, nullptr);
|
||||
err = clGetPlatformInfo(platform, INVALID_PARAM_VALUE, 0, nullptr, nullptr);
|
||||
test_failure_error_ret(
|
||||
err, CL_INVALID_VALUE,
|
||||
"clGetPlatformInfo should return CL_INVALID_VALUE when: \"param_name "
|
||||
|
||||
Reference in New Issue
Block a user