@@ -4517,4 +4517,41 @@ void testgetObjectInfo() {
45174517 TEST_ASSERT_EQUAL (type, CL_GL_OBJECT_BUFFER);
45184518 TEST_ASSERT_EQUAL (bufobj, 0 );
45194519}
4520+ static void *clEnqueueMapBuffer_testenqueueMapBuffer (
4521+ cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map,
4522+ cl_map_flags map_flags, size_t offset, size_t size,
4523+ cl_uint num_events_in_wait_list, const cl_event *event_wait_list,
4524+ cl_event *event, cl_int *errcode_ret, int num_calls) {
4525+ (void )command_queue;
4526+ TEST_ASSERT_EQUAL_PTR (make_mem (0 ), buffer);
4527+ TEST_ASSERT_EQUAL (CL_TRUE, blocking_map);
4528+ TEST_ASSERT_EQUAL (CL_MAP_WRITE, map_flags);
4529+ TEST_ASSERT_EQUAL (0 , offset);
4530+ TEST_ASSERT_EQUAL (sizeof (int ) * 1024 , size);
4531+ TEST_ASSERT_EQUAL (0 , num_events_in_wait_list);
4532+ TEST_ASSERT_EQUAL_PTR (nullptr , event_wait_list);
4533+ TEST_ASSERT_NOT_NULL (event);
4534+ TEST_ASSERT_NOT_EQUAL (nullptr , errcode_ret);
4535+ TEST_ASSERT_EQUAL (0 , num_calls);
4536+ return make_mem (0 );
4537+ }
4538+ void testenqueueMapBuffer () {
4539+ cl_bool blocking = CL_TRUE;
4540+ cl_map_flags flags = CL_MAP_WRITE;
4541+ cl::size_type offset = 0 ;
4542+ cl::size_type size = sizeof (int ) * 1024 ;
4543+ cl::Event event_data (make_event (0 ), false );
4544+ cl::Event *event = &event_data;
4545+ const cl::vector<cl::Event> *events = nullptr ;
4546+ cl_int *err = nullptr ;
4547+ void *ret = nullptr ;
4548+
4549+ clEnqueueMapBuffer_StubWithCallback (
4550+ clEnqueueMapBuffer_testenqueueMapBuffer);
4551+ ret = enqueueMapBuffer (bufferPool[0 ], blocking, flags, offset, size, events,
4552+ event, err);
4553+
4554+ TEST_ASSERT_EQUAL_PTR (make_mem (0 ), ret);
4555+ event_data () = nullptr ;
4556+ }
45204557} // extern "C"
0 commit comments