@@ -4517,4 +4517,35 @@ void testgetObjectInfo() {
45174517 TEST_ASSERT_EQUAL (type, CL_GL_OBJECT_BUFFER);
45184518 TEST_ASSERT_EQUAL (bufobj, 0 );
45194519}
4520+ #if CL_HPP_TARGET_OPENCL_VERSION >= 110
4521+ static cl_mem clCreateSubBuffer_testCreateSubBuffer (
4522+ cl_mem buffer, cl_mem_flags flags, cl_buffer_create_type buffer_create_type,
4523+ const void *buffer_create_info, cl_int *errcode_ret, int num_calls) {
4524+ (void )errcode_ret;
4525+ TEST_ASSERT_EQUAL (make_mem (0 ), buffer);
4526+ TEST_ASSERT_EQUAL (0 , flags);
4527+ TEST_ASSERT_EQUAL (0 , buffer_create_type);
4528+ TEST_ASSERT_EQUAL_PTR (nullptr , buffer_create_info);
4529+ TEST_ASSERT_EQUAL (0 , num_calls);
4530+
4531+ return make_mem (1 );
4532+ }
4533+
4534+ void testCreateSubBuffer () {
4535+ cl_mem_flags flags = 0 ;
4536+ cl_buffer_create_type buffer_create_type = 0 ;
4537+ const void *buffer_create_info = nullptr ;
4538+ cl_int *err = nullptr ;
4539+ static cl::Buffer ret;
4540+
4541+ clCreateSubBuffer_StubWithCallback (clCreateSubBuffer_testCreateSubBuffer);
4542+ ret = bufferPool[0 ].createSubBuffer (flags, buffer_create_type,
4543+ buffer_create_info, err);
4544+
4545+ TEST_ASSERT_EQUAL_PTR (make_mem (1 ), ret ());
4546+ ret () = nullptr ;
4547+ }
4548+ #else
4549+ void testCreateSubBuffer () {}
4550+ #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110
45204551} // extern "C"
0 commit comments