]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados_test_stub: add mock version of `create` 20860/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 14 Dec 2017 19:09:10 +0000 (14:09 -0500)
committerPrashant D <pdhange@redhat.com>
Tue, 13 Mar 2018 08:38:41 +0000 (04:38 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit ed147192fdc1cc589cdfb107f5d1264568492e88)

src/test/librados_test_stub/MockTestMemIoCtxImpl.h

index d6fb2647433998e16a4a5c2b1e7981978e678ded..39c0e1ecb9dad9dc6e12e67b6d72d2bb6e5439f8 100644 (file)
@@ -60,6 +60,11 @@ public:
     return TestMemIoCtxImpl::assert_exists(oid);
   }
 
+  MOCK_METHOD2(create, int(const std::string&, bool));
+  int do_create(const std::string& oid, bool exclusive) {
+    return TestMemIoCtxImpl::create(oid, exclusive);
+  }
+
   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);
@@ -193,6 +198,7 @@ public:
     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, create(_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_create));
     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));