test/aio: aio completion is not released

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
This commit is contained in:
Zhiqiang Wang 2015-05-21 14:58:20 +08:00
parent 783fdc7c3e
commit 855a70d83e

View File

@ -209,17 +209,19 @@ TEST(LibRadosAio, SimpleWrite) {
ASSERT_EQ(0, rados_aio_get_return_value(my_completion));
rados_ioctx_set_namespace(test_data.m_ioctx, "nspace");
rados_completion_t my_completion2;
ASSERT_EQ(0, rados_aio_create_completion((void*)&test_data,
set_completion_complete, set_completion_safe, &my_completion));
set_completion_complete, set_completion_safe, &my_completion2));
ASSERT_EQ(0, rados_aio_write(test_data.m_ioctx, "foo",
my_completion, buf, sizeof(buf), 0));
my_completion2, buf, sizeof(buf), 0));
{
TestAlarm alarm;
sem_wait(&test_data.m_sem);
sem_wait(&test_data.m_sem);
}
ASSERT_EQ(0, rados_aio_get_return_value(my_completion));
ASSERT_EQ(0, rados_aio_get_return_value(my_completion2));
rados_aio_release(my_completion);
rados_aio_release(my_completion2);
}
TEST(LibRadosAio, SimpleWritePP) {
@ -1806,17 +1808,19 @@ TEST(LibRadosAioEC, SimpleWrite) {
ASSERT_EQ(0, rados_aio_get_return_value(my_completion));
rados_ioctx_set_namespace(test_data.m_ioctx, "nspace");
rados_completion_t my_completion2;
ASSERT_EQ(0, rados_aio_create_completion((void*)&test_data,
set_completion_completeEC, set_completion_safeEC, &my_completion));
set_completion_completeEC, set_completion_safeEC, &my_completion2));
ASSERT_EQ(0, rados_aio_write(test_data.m_ioctx, "foo",
my_completion, buf, sizeof(buf), 0));
my_completion2, buf, sizeof(buf), 0));
{
TestAlarm alarm;
sem_wait(&test_data.m_sem);
sem_wait(&test_data.m_sem);
}
ASSERT_EQ(0, rados_aio_get_return_value(my_completion));
ASSERT_EQ(0, rados_aio_get_return_value(my_completion2));
rados_aio_release(my_completion);
rados_aio_release(my_completion2);
}
TEST(LibRadosAioEC, SimpleWritePP) {