[Piglit] [PATCH v2] cl: From API clRetain* tests, removed attempt to release already released and destroyed objects
Ville Korhonen
ville.t.korhonen at tut.fi
Mon Sep 2 06:05:47 PDT 2013
removed changes to create-context. Fixed also create-context-from-type
test which was trying to create context with NULL platform.
diff --git a/tests/cl/api/create-context-from-type.c
b/tests/cl/api/create-context-from-type.c
index 3ed1ba4..acd072f 100644
--- a/tests/cl/api/create-context-from-type.c
+++ b/tests/cl/api/create-context-from-type.c
@@ -221,40 +221,7 @@ piglit_cl_test(const int argc,
/*** Errors ***/
- /*
- * CL_INVALID_PLATFORM if properties is NULL and no platform
- * could be selected or if platform value specified in properties
- * is not a valid platform.
- *
- * Note: Can not test implementation-defined behaviour on
- * NULL context_properties.
- */
- cl_ctx = clCreateContextFromType(invalid_platform_context_properties,
- CL_DEVICE_TYPE_ALL,
- NULL,
- NULL,
- &errNo);
- if( errNo != CL_INVALID_PLATFORM
-#if defined(CL_VERSION_1_1)
- && errNo != CL_INVALID_PROPERTY
-#endif
- ) {
- test(invalid_platform_context_properties, CL_DEVICE_TYPE_ALL,
- NULL, NULL,
- CL_INVALID_PLATFORM, &result,
- "Trigger CL_INVALID_PLATFORM if platform value specified in
properties is not a valid platform");
-#if defined(CL_VERSION_1_1)
- printf("Another valid expected CL error: %d\n", CL_INVALID_PROPERTY);
-#endif
- piglit_merge_result(&result, PIGLIT_FAIL);
- } else if (cl_ctx != NULL) {
- test(invalid_platform_context_properties, CL_DEVICE_TYPE_ALL,
- NULL, NULL,
- CL_INVALID_PLATFORM, &result,
- "Trigger CL_INVALID_PLATFORM if platform value specified in
properties is not a valid platform");
- }
-
- /*
+ /*
* CL_INVALID_VALUE if context property name in properties is
* not a supported property name, or if pfn_notify is NULL but
* user_data is not NULL.
@@ -275,6 +242,7 @@ piglit_cl_test(const int argc,
test(context_properties, CL_DEVICE_TYPE_ALL, NULL, &context_properties,
CL_INVALID_VALUE, &result,
"Trigger CL_INVALID_VALUE if pfn_notify is NULL and user_data
is not NULL");
+
/*
* CL_INVALID_PROPERTY if context property name in properties
@@ -289,9 +257,6 @@ piglit_cl_test(const int argc,
*/
#if defined(CL_VERSION_1_1)
if(env->version >= 11) {
- test(invalid_context_properties, CL_DEVICE_TYPE_ALL, NULL, NULL,
- CL_INVALID_PROPERTY, &result,
- "Trigger CL_INVALID_PROPERTY if context property name in
properties is not a supported property name");
test(multiple_platform_context_properties, CL_DEVICE_TYPE_ALL,
NULL, NULL,
CL_INVALID_PROPERTY, &result,
diff --git a/tests/cl/api/get-device-ids.c b/tests/cl/api/get-device-ids.c
index d4fcdf7..f4a0a11 100644
--- a/tests/cl/api/get-device-ids.c
+++ b/tests/cl/api/get-device-ids.c
@@ -193,20 +193,5 @@ piglit_cl_test(const int argc,
* PIGLIT_FAIL);
*/
- /*
- * CL_INVALID_PLATFORM if platform is not a valid platform.
- */
- errNo = clGetDeviceIDs(invalid_platform_id,
- CL_DEVICE_TYPE_ALL,
- 0,
- NULL,
- &num_devices);
- if(!piglit_cl_check_error(errNo, CL_INVALID_PLATFORM)) {
- fprintf(stderr,
- "Failed (error code: %s): Trigger CL_INVALID_PLATFORM if
platform is not a valid platform.\n",
- piglit_cl_get_error_name(errNo));
- piglit_merge_result(&result, PIGLIT_FAIL);
- }
-
return result;
}
diff --git a/tests/cl/api/get-platform-info.c
b/tests/cl/api/get-platform-info.c
index c5cd4e0..cf61586 100644
--- a/tests/cl/api/get-platform-info.c
+++ b/tests/cl/api/get-platform-info.c
@@ -154,21 +154,5 @@ piglit_cl_test(const int argc,
piglit_merge_result(&result, PIGLIT_FAIL);
}
- /*
- * CL_INVALID_PLATFORM if platform is not a valid platform.
- */
- errNo = clGetPlatformInfo(invalid_platform_id,
- CL_PLATFORM_PROFILE,
- 0,
- NULL,
- ¶m_value_size);
- if(!piglit_cl_check_error(errNo, CL_INVALID_PLATFORM)) {
- fprintf(stderr,
- "Failed (error code: %s): Trigger CL_INVALID_PLATFORM if
platform is not a valid platform.\n",
- piglit_cl_get_error_name(errNo));
- piglit_merge_result(&result, PIGLIT_FAIL);
- }
-
-
- return result;
+ return result;
}
diff --git a/tests/cl/api/retain_release-command-queue.c
b/tests/cl/api/retain_release-command-queue.c
index a4e8ffb..3eb746c 100644
--- a/tests/cl/api/retain_release-command-queue.c
+++ b/tests/cl/api/retain_release-command-queue.c
@@ -139,25 +139,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
- */
- errNo = clReleaseCommandQueue(command_queue);
- if(!piglit_cl_check_error(errNo, CL_INVALID_COMMAND_QUEUE)) {
- fprintf(stderr,
- "clReleaseCommandQueue: Failed (error code: %s): Trigger
CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue
(already released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseCommandQueue(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_COMMAND_QUEUE)) {
- fprintf(stderr,
- "clReleaseCommandQueue: Failed (error code: %s): Trigger
CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue
(NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
return PIGLIT_PASS;
}
diff --git a/tests/cl/api/retain_release-context.c
b/tests/cl/api/retain_release-context.c
index 6aaa4d9..b2bcd78 100644
--- a/tests/cl/api/retain_release-context.c
+++ b/tests/cl/api/retain_release-context.c
@@ -148,25 +148,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_CONTEXT if context is not a valid OpenCL context.
- */
- errNo = clReleaseContext(cl_ctx);
- if(!piglit_cl_check_error(errNo, CL_INVALID_CONTEXT)) {
- fprintf(stderr,
- "clReleaseContext: Failed (error code: %s): Trigger
CL_INVALID_CONTEXT if context is not a valid context (already
released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseContext(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_CONTEXT)) {
- fprintf(stderr,
- "clReleaseContext: Failed (error code: %s): Trigger
CL_INVALID_CONTEXT if context is not a valid context (NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
return PIGLIT_PASS;
}
diff --git a/tests/cl/api/retain_release-event.c
b/tests/cl/api/retain_release-event.c
index bfff199..f1a8170 100644
--- a/tests/cl/api/retain_release-event.c
+++ b/tests/cl/api/retain_release-event.c
@@ -149,27 +149,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_EVENT if event is not a valid event object.
- */
- errNo = clReleaseEvent(event);
- if(!piglit_cl_check_error(errNo, CL_INVALID_EVENT)) {
- fprintf(stderr,
- "clReleaseEvent: Failed (error code: %s): Trigger
CL_INVALID_EVENT if event is not a valid event object (already
released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseEvent(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_EVENT)) {
- fprintf(stderr,
- "clReleaseEvent: Failed (error code: %s): Trigger
CL_INVALID_EVENT if event is not a valid event object (NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
- clReleaseMemObject(memobj);
-
return PIGLIT_PASS;
}
diff --git a/tests/cl/api/retain_release-kernel.c
b/tests/cl/api/retain_release-kernel.c
index 94857d2..4bad2de 100644
--- a/tests/cl/api/retain_release-kernel.c
+++ b/tests/cl/api/retain_release-kernel.c
@@ -137,25 +137,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_KERNEL if kernel is not a valid kernel object.
- */
- errNo = clReleaseKernel(kernel);
- if(!piglit_cl_check_error(errNo, CL_INVALID_KERNEL)) {
- fprintf(stderr,
- "clReleaseKernel: Failed (error code: %s): Trigger
CL_INVALID_KERNEL if kernel is not a valid kernel object (already
released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseKernel(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_KERNEL)) {
- fprintf(stderr,
- "clReleaseKernel: Failed (error code: %s): Trigger
CL_INVALID_KERNEL if kernel is not a valid kernel object (NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
return PIGLIT_PASS;
}
diff --git a/tests/cl/api/retain_release-mem-object.c
b/tests/cl/api/retain_release-mem-object.c
index ae4555f..286d46e 100644
--- a/tests/cl/api/retain_release-mem-object.c
+++ b/tests/cl/api/retain_release-mem-object.c
@@ -138,26 +138,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_MEM_OBJECT if mem_object is not a valid mem_object object
- * (buffer or image object).
- */
- errNo = clReleaseMemObject(memobj);
- if(!piglit_cl_check_error(errNo, CL_INVALID_MEM_OBJECT)) {
- fprintf(stderr,
- "clReleaseMemObject: Failed (error code: %s): Trigger
CL_INVALID_MEM_OBJECT if memOBJ is not a valid memory object (already
released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseMemObject(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_MEM_OBJECT)) {
- fprintf(stderr,
- "clReleaseMemObject: Failed (error code: %s): Trigger
CL_INVALID_MEM_OBJECT if memobj is not a valid memory object (NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
return PIGLIT_PASS;
}
diff --git a/tests/cl/api/retain_release-program.c
b/tests/cl/api/retain_release-program.c
index aba5426..cf20dc8 100644
--- a/tests/cl/api/retain_release-program.c
+++ b/tests/cl/api/retain_release-program.c
@@ -140,25 +140,5 @@ piglit_cl_test(const int argc,
}
}
- /*** Errors ***/
-
- /*
- * CL_INVALID_PROGRAM if program is not a valid program object.
- */
- errNo = clReleaseProgram(program);
- if(!piglit_cl_check_error(errNo, CL_INVALID_PROGRAM)) {
- fprintf(stderr,
- "clReleaseProgram: Failed (error code: %s): Trigger
CL_INVALID_PROGRAM if program is not a valid program object (already
released).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
- errNo = clReleaseProgram(NULL);
- if(!piglit_cl_check_error(errNo, CL_INVALID_PROGRAM)) {
- fprintf(stderr,
- "clReleaseProgram: Failed (error code: %s): Trigger
CL_INVALID_PROGRAM if program is not a valid program object (NULL).\n",
- piglit_cl_get_error_name(errNo));
- return PIGLIT_FAIL;
- }
-
return PIGLIT_PASS;
}
More information about the Piglit
mailing list