]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados_test_stub: mock wrapper for aio_notify
authorMykola Golub <mgolub@mirantis.com>
Thu, 20 Apr 2017 09:51:55 +0000 (11:51 +0200)
committerMykola Golub <mgolub@mirantis.com>
Thu, 20 Apr 2017 12:29:14 +0000 (14:29 +0200)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/test/librados_test_stub/MockTestMemIoCtxImpl.h

index 3d06d4fd8069cdd3a8a239d072652a7ef3ee3636..e1d703dceff1c8bb3ac2e8076369f8c21089d952 100644 (file)
@@ -35,6 +35,14 @@ public:
     return io_ctx_impl;
   }
 
+  MOCK_METHOD5(aio_notify, void(const std::string& o, AioCompletionImpl *c,
+                                bufferlist& bl, uint64_t timeout_ms,
+                                bufferlist *pbl));
+  void do_aio_notify(const std::string& o, AioCompletionImpl *c, bufferlist& bl,
+                     uint64_t timeout_ms, bufferlist *pbl) {
+    return TestMemIoCtxImpl::aio_notify(o, c, bl, timeout_ms, pbl);
+  }
+
   MOCK_METHOD4(aio_watch, int(const std::string& o, AioCompletionImpl *c,
                               uint64_t *handle, librados::WatchCtx2 *ctx));
   int do_aio_watch(const std::string& o, AioCompletionImpl *c,
@@ -155,6 +163,7 @@ public:
   void default_to_parent() {
     using namespace ::testing;
 
+    ON_CALL(*this, aio_notify(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_notify));
     ON_CALL(*this, aio_watch(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_watch));
     ON_CALL(*this, aio_unwatch(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_unwatch));
     ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec));