Note that default tests maintain state when run from the same unit process. One default setting test will maintain the defaults until the end.
| 3298 | // unit process. |
| 3299 | // One default setting test will maintain the defaults until the end. |
| 3300 | void testSetDefaultDevice(void) |
| 3301 | { |
| 3302 | clGetDeviceInfo_StubWithCallback(clGetDeviceInfo_platform); |
| 3303 | clGetPlatformInfo_StubWithCallback(clGetPlatformInfo_version_2_0); |
| 3304 | |
| 3305 | clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3306 | clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3307 | clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3308 | clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3309 | clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3310 | clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 3311 | |
| 3312 | cl::Device d(make_device_id(1)); |
| 3313 | cl::Device d2 = cl::Device::setDefault(d); |
| 3314 | cl::Device d3 = cl::Device::getDefault(); |
| 3315 | TEST_ASSERT_EQUAL(d(), d2()); |
| 3316 | TEST_ASSERT_EQUAL(d(), d3()); |
| 3317 | } |
| 3318 | |
| 3319 | #if CL_HPP_TARGET_OPENCL_VERSION >= 200 |
| 3320 | static cl_command_queue clCreateCommandQueueWithProperties_testCommandQueueDevice( |
nothing calls this directly
no test coverage detected