]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados_test_stub: additional mocked IoCtx methods
authorJason Dillaman <dillaman@redhat.com>
Sat, 5 Dec 2015 02:44:55 +0000 (21:44 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 15 Dec 2015 01:30:51 +0000 (20:30 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librados_test_stub/MockTestMemIoCtxImpl.h

index 198db6ccb6861617a77257736ec5822786aea8e8..596436b33e727462672cdcc4896b778eb7e02e41 100644 (file)
@@ -72,6 +72,14 @@ public:
     return TestMemIoCtxImpl::selfmanaged_snap_remove(snap_id);
   }
 
+  MOCK_METHOD3(truncate, int(const std::string& oid,
+                             uint64_t size,
+                             const SnapContext &snapc));
+  int do_truncate(const std::string& oid, uint64_t size,
+                  const SnapContext &snapc) {
+    return TestMemIoCtxImpl::truncate(oid, size, snapc);
+  }
+
   MOCK_METHOD3(write_full, int(const std::string& oid,
                                bufferlist& bl,
                                const SnapContext &snapc));
@@ -88,6 +96,7 @@ public:
     ON_CALL(*this, remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_remove));
     ON_CALL(*this, selfmanaged_snap_create(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_create));
     ON_CALL(*this, selfmanaged_snap_remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_remove));
+    ON_CALL(*this, truncate(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_truncate));
     ON_CALL(*this, write_full(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write_full));
   }