Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-wozniak-mobica committed Aug 1, 2023
1 parent 0c395f4 commit 2a35ccd
Showing 1 changed file with 3 additions and 37 deletions.
40 changes: 3 additions & 37 deletions tests/test_openclhpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4343,17 +4343,7 @@ static cl_mem clCreateFromGLBuffer_testgetObjectInfo(cl_context context,
cl_int *errcode_ret,
int num_calls)
{
switch (num_calls) {
case 0:
TEST_ASSERT_EQUAL(0, bufobj);
break;
case 1:
TEST_ASSERT_EQUAL(1, bufobj);
break;
default:
break;
}

TEST_ASSERT_EQUAL(0, bufobj);
TEST_ASSERT_EQUAL_PTR(make_context(0), context);
TEST_ASSERT_EQUAL(0, flags);
if (errcode_ret)
Expand All @@ -4366,28 +4356,10 @@ static cl_int clGetGLObjectInfo_testgetObjectInfo(cl_mem memobj,
cl_GLuint *gl_object_name,
int num)
{
cl_int ret = CL_SUCCESS;
TEST_ASSERT_EQUAL(memobj, make_mem(0));
switch (num) {
case 0:
TEST_ASSERT_EQUAL(CL_GL_OBJECT_TEXTURE2D_ARRAY, *type);
*type = CL_GL_OBJECT_BUFFER;
break;
case 1:
TEST_ASSERT_EQUAL(CL_GL_OBJECT_BUFFER, *type);
*type = CL_GL_OBJECT_TEXTURE2D_ARRAY;
ret = CL_DEVICE_NOT_FOUND;
break;
default:
break;
}
*type = CL_GL_OBJECT_BUFFER;

*gl_object_name = 0;
return ret;
}

cl_int clReleaseMemObject_testgetObjectInfo(cl_mem memobj, int ret)
{
return CL_SUCCESS;
}

Expand All @@ -4400,7 +4372,7 @@ void testgetObjectInfo() {
clGetGLObjectInfo_StubWithCallback(clGetGLObjectInfo_testgetObjectInfo);
clCreateFromGLBuffer_StubWithCallback(
clCreateFromGLBuffer_testgetObjectInfo);
clReleaseMemObject_StubWithCallback(clReleaseMemObject_testgetObjectInfo);
clReleaseMemObject_ExpectAndReturn(make_mem(0), CL_SUCCESS);
cl::BufferGL buffer(contextPool[0], flags, bufobj, &err);

TEST_ASSERT_EQUAL_PTR(make_mem(0), buffer());
Expand All @@ -4409,11 +4381,5 @@ void testgetObjectInfo() {
TEST_ASSERT_EQUAL(buffer.getObjectInfo(&type, &bufobj), CL_SUCCESS);
TEST_ASSERT_EQUAL(type, CL_GL_OBJECT_BUFFER);
TEST_ASSERT_EQUAL(bufobj, 0);
type = CL_GL_OBJECT_BUFFER;
bufobj = 1;

TEST_ASSERT_EQUAL(buffer.getObjectInfo(&type, &bufobj), CL_DEVICE_NOT_FOUND);
TEST_ASSERT_EQUAL(type, CL_GL_OBJECT_TEXTURE2D_ARRAY);
TEST_ASSERT_EQUAL(bufobj, 0);
}
} // extern "C"

0 comments on commit 2a35ccd

Please sign in to comment.