mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Add negative tests for context API functions (#2494)
This PR adds negative tests for the following API functions: - clCreateContext - clCreateContextFromType - clRetainContext - clReleaseContext - clSetContextDestructorCallback Also, define a new macro `test_object_failure_ret` to test for an expected error code and the returned object is `NULL` as a result of a failure. Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This commit is contained in:
@@ -120,6 +120,12 @@ static int vlog_win32(const char *format, ...);
|
||||
return retValue; \
|
||||
} \
|
||||
}
|
||||
#define test_object_failure_ret(object, errCode, expectedErrCode, msg, \
|
||||
retValue) \
|
||||
{ \
|
||||
test_assert_error_ret(object == nullptr, msg, retValue); \
|
||||
test_failure_error_ret(errCode, expectedErrCode, msg, retValue); \
|
||||
}
|
||||
#define print_failure_error(errCode, expectedErrCode, msg) \
|
||||
log_error("ERROR: %s! (Got %s, expected %s from %s:%d)\n", msg, \
|
||||
IGetErrorString(errCode), IGetErrorString(expectedErrCode), \
|
||||
|
||||
Reference in New Issue
Block a user