-
Notifications
You must be signed in to change notification settings - Fork 35
Add IPC tests for using an allocation after umfCloseIPCHandle()
#840
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
Add IPC tests for using an allocation after umfCloseIPCHandle()
#840
Conversation
ad0aa59
to
c4a3db9
Compare
Rebased |
c4a3db9
to
ac0f5bd
Compare
ac0f5bd
to
30d0ea1
Compare
30d0ea1
to
ebe4ac6
Compare
test/ipcFixtures.hpp
Outdated
@@ -328,8 +340,19 @@ TEST_P(umfIpcTest, AllocFreeAllocTest) { | |||
ret = umfPoolFree(pool.get(), ptr); | |||
EXPECT_EQ(ret, UMF_RESULT_SUCCESS); | |||
|
|||
// Test if umfCloseIPCHandle() did not corrupt the pool | |||
// and if umfPoolMalloc() works correctly after umfCloseIPCHandle(). | |||
ptr = umfPoolMalloc(pool.get(), SIZE); |
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.
But L325 already calls umfPoolMalloc
after the umfCloseIPCHandle
function. Why we need to check it again?
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.
Right. Changed to test for using an allocation after umfCloseIPCHandle()
.
test/ipcFixtures.hpp
Outdated
// Test if umfCloseIPCHandle() did not corrupt the pool | ||
// and if umfPoolMalloc() works correctly after umfCloseIPCHandle(). | ||
ptr = (int *)umfPoolMalloc(pool.get(), SIZE); | ||
EXPECT_NE(ptr, nullptr); | ||
|
||
// use the allocated memory - fill it with a 0xAB pattern | ||
const uint32_t pattern = 0xAB; | ||
memAccessor->fill(ptr, SIZE, &pattern, sizeof(pattern)); | ||
|
||
ret = umfPoolFree(pool.get(), ptr); | ||
EXPECT_EQ(ret, UMF_RESULT_SUCCESS); | ||
|
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.
It looks like a duplication. The AllocFreeAllocTest
tests the same scenario.
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.
Removed
umfPoolMalloc()
after umfCloseIPCHandle()
umfCloseIPCHandle()
Add IPC tests for using an allocation after umfCloseIPCHandle(). Test if umfPoolMalloc() returns a usable pointer after umfCloseIPCHandle(). Signed-off-by: Lukasz Dorau <[email protected]>
ebe4ac6
to
65e988a
Compare
Description
Add IPC tests for using an allocation after
umfCloseIPCHandle()
.Test if
umfPoolMalloc()
returns a usable pointer afterumfCloseIPCHandle()
.Checklist