LibRadosAio: WaitForSafePP

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
Colin Patrick McCabe 2011-08-12 14:55:07 -07:00
parent ffab58f7d7
commit e2d4462ad7

View File

@ -191,6 +191,24 @@ TEST(LibRadosAio, WaitForSafe) {
rados_aio_release(my_completion);
}
TEST(LibRadosAio, WaitForSafePP) {
AioTestDataPP test_data;
ASSERT_EQ("", test_data.init());
AioCompletion *my_completion = test_data.m_cluster.aio_create_completion(
(void*)&test_data, set_completion_complete, set_completion_safe);
AioCompletion *my_completion_null = NULL;
ASSERT_NE(my_completion, my_completion_null);
char buf[128];
memset(buf, 0xcc, sizeof(buf));
bufferlist bl1;
bl1.append(buf, sizeof(buf));
ASSERT_EQ(0, test_data.m_ioctx.aio_write("foo",
my_completion, bl1, sizeof(buf), 0));
TestAlarm alarm;
ASSERT_EQ(0, my_completion->wait_for_safe());
delete my_completion;
}
TEST(LibRadosAio, RoundTrip) {
AioTestData test_data;
rados_completion_t my_completion;