From 62d8f494100830902416efc39fb056b5edcc9d59 Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Thu, 4 Jul 2024 13:48:28 +0200 Subject: [PATCH] Corrected condition to allow both CL_INVALID_PROPERTY and CL_INVALID_VALUE in overlapping cases --- .../test_semaphores_negative_create.cpp | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/test_conformance/extensions/cl_khr_semaphore/test_semaphores_negative_create.cpp b/test_conformance/extensions/cl_khr_semaphore/test_semaphores_negative_create.cpp index 30daf6c33..282c43c4a 100644 --- a/test_conformance/extensions/cl_khr_semaphore/test_semaphores_negative_create.cpp +++ b/test_conformance/extensions/cl_khr_semaphore/test_semaphores_negative_create.cpp @@ -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 @@ -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 @@ -128,7 +140,7 @@ struct CreateInvalidProperty : public SemaphoreTestBase "Unexpected clCreateSemaphoreWithPropertiesKHR return"); } - return CL_SUCCESS; + return TEST_PASS; } };