-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UT for EnqueueMapBuffer #259
base: main
Are you sure you want to change the base?
UT for EnqueueMapBuffer #259
Conversation
d6dd6d3
to
4603963
Compare
tests/test_openclhpp.cpp
Outdated
TEST_ASSERT_EQUAL(sizeof(int) * 1024, size); | ||
TEST_ASSERT_EQUAL(0, num_events_in_wait_list); | ||
TEST_ASSERT_EQUAL_PTR(nullptr, event_wait_list); | ||
TEST_ASSERT_NOT_NULL(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event pointer is an optional output, so if the pointer is non-NULL then we should be writing a value to it (e.g. make_event(N)
, and checking that the expected value was written in the calling function.
See, for example:
OpenCL-CLHPP/tests/test_openclhpp.cpp
Lines 3772 to 3774 in f96b8f8
if (event != nullptr) { *event = make_event(1); OpenCL-CLHPP/tests/test_openclhpp.cpp
Line 3791 in f96b8f8
TEST_ASSERT_EQUAL_PTR(make_event(1), event());
tests/test_openclhpp.cpp
Outdated
ret = enqueueMapBuffer(bufferPool[0], blocking, flags, offset, size, events, | ||
event, err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a very strong opinion about this, but it would require less code to pass in some of these values directly vs. assigning them to a variable first.
ret = enqueueMapBuffer(bufferPool[0], blocking, flags, offset, size, events, | |
event, err); | |
ret = enqueueMapBuffer(bufferPool[0], CL_TRUE, CL_MAP_WRITE, 0, sizeof(int) * 1024, events, | |
event, err); |
@bashbaug Added corrections. |
No description provided.