MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CLHPP / testMoveAssignDeviceNonNull

Function testMoveAssignDeviceNonNull

tests/test_openclhpp.cpp:1195–1213  ·  view source on GitHub ↗

These tests do not use the MAKE_MOVE_TESTS helper because they need to check whether the device is reference-countable, and to check that the reference-countable flag is correctly moved.

Source from the content-addressed store, hash-verified

1193// check whether the device is reference-countable, and to check that
1194// the reference-countable flag is correctly moved.
1195void testMoveAssignDeviceNonNull(void)
1196{
1197#ifdef TEST_RVALUE_REFERENCES
1198 clGetDeviceInfo_StubWithCallback(clGetDeviceInfo_platform);
1199 clGetPlatformInfo_StubWithCallback(clGetPlatformInfo_version_1_2);
1200
1201 // Release called when trg overwritten
1202 clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
1203
1204 cl::Device src(make_device_id(0));
1205 cl::Device trg(make_device_id(1));
1206 trg = std::move(src);
1207 TEST_ASSERT_EQUAL_PTR(make_device_id(0), trg());
1208 TEST_ASSERT_NULL(src());
1209
1210 // Prevent destructor from interfering with the test
1211 trg() = nullptr;
1212#endif
1213}
1214
1215void testMoveAssignDeviceNull(void)
1216{

Callers

nothing calls this directly

Calls 1

make_device_idFunction · 0.85

Tested by

no test coverage detected