]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add test for list_watchers() C++ interface
authorDavid Zafman <david.zafman@inktank.com>
Fri, 22 Feb 2013 05:45:06 +0000 (21:45 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 22 Feb 2013 05:50:02 +0000 (21:50 -0800)
Signed-off-by: David Zafman <david.zafman@inktank.com>
src/test/librados/watch_notify.cc

index b2de96d1332c4a7962999181cfc084ae8227ec27..d6cb8a0cee3fe90f3521adeaa95893c63e1b2449 100644 (file)
@@ -1,5 +1,6 @@
 #include "include/rados/librados.h"
 #include "include/rados/librados.hpp"
+#include "include/rados/rados_types.h"
 #include "test/librados/test.h"
 
 #include <errno.h>
@@ -61,6 +62,9 @@ TEST(LibRadosWatchNotify, WatchNotifyTestPP) {
   uint64_t handle;
   WatchNotifyTestCtx ctx;
   ASSERT_EQ(0, ioctx.watch("foo", 0, &handle, &ctx));
+  std::list<obj_watch_t> watches;
+  ASSERT_EQ(0, ioctx.list_watchers("foo", &watches));
+  ASSERT_EQ(watches.size(), 1);
   bufferlist bl2;
   ASSERT_EQ(0, ioctx.notify("foo", 0, bl2));
   TestAlarm alarm;