]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/librados_test_stub/MockTestMemIoCtxImpl.h
update sources to v12.2.3
[ceph.git] / ceph / src / test / librados_test_stub / MockTestMemIoCtxImpl.h
index 03c6c326de598fd9fab1ad49eaf1af2b8ff21e2a..d6fb2647433998e16a4a5c2b1e7981978e678ded 100644 (file)
@@ -55,6 +55,16 @@ public:
     return TestMemIoCtxImpl::aio_unwatch(handle, c);
   }
 
+  MOCK_METHOD1(assert_exists, int(const std::string &));
+  int do_assert_exists(const std::string &oid) {
+    return TestMemIoCtxImpl::assert_exists(oid);
+  }
+
+  MOCK_METHOD3(cmpext, int(const std::string&, uint64_t, bufferlist&));
+  int do_cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) {
+    return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl);
+  }
+
   MOCK_METHOD7(exec, int(const std::string& oid,
                          TestClassHandler *handler,
                          const char *cls,
@@ -160,12 +170,30 @@ public:
     return TestMemIoCtxImpl::write_full(oid, bl, snapc);
   }
 
+
+  MOCK_METHOD5(writesame, int(const std::string& oid, bufferlist& bl,
+                              size_t len, uint64_t off,
+                              const SnapContext &snapc));
+  int do_writesame(const std::string& oid, bufferlist& bl, size_t len,
+                   uint64_t off, const SnapContext &snapc) {
+    return TestMemIoCtxImpl::writesame(oid, bl, len, off, snapc);
+  }
+
+  MOCK_METHOD4(zero, int(const std::string& oid, uint64_t offset,
+                         uint64_t length, const SnapContext &snapc));
+  int do_zero(const std::string& oid, uint64_t offset,
+              uint64_t length, const SnapContext &snapc) {
+    return TestMemIoCtxImpl::zero(oid, offset, length, snapc);
+  }
+
   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, assert_exists(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_exists));
+    ON_CALL(*this, cmpext(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext));
     ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec));
     ON_CALL(*this, get_instance_id()).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_get_instance_id));
     ON_CALL(*this, list_snaps(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_snaps));
@@ -181,6 +209,8 @@ public:
     ON_CALL(*this, truncate(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_truncate));
     ON_CALL(*this, write(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write));
     ON_CALL(*this, write_full(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write_full));
+    ON_CALL(*this, writesame(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_writesame));
+    ON_CALL(*this, zero(_,_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_zero));
   }
 
 private: