o->ops.push_back(op);
}
+void ObjectReadOperation::list_watchers(std::list<obj_watch_t> *out_watchers,
+ int *prval) {
+ TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
+
+ ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::list_watchers, _1,
+ _2, out_watchers);
+ if (prval != NULL) {
+ op = boost::bind(save_operation_result,
+ boost::bind(op, _1, _2, _3, _4), prval);
+ }
+ o->ops.push_back(op);
+}
+
void ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *pbl,
int *prval) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
snapc);
}
+ MOCK_METHOD2(list_watchers, int(const std::string& o,
+ std::list<obj_watch_t> *out_watchers));
+ int do_list_watchers(const std::string& o,
+ std::list<obj_watch_t> *out_watchers) {
+ return TestMemIoCtxImpl::list_watchers(o, out_watchers);
+ }
+
MOCK_METHOD4(read, int(const std::string& oid,
size_t len,
uint64_t off,
using namespace ::testing;
ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec));
+ ON_CALL(*this, list_watchers(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_watchers));
ON_CALL(*this, read(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_read));
ON_CALL(*this, remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_remove));
ON_CALL(*this, selfmanaged_snap_create(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_create));
this, this, pool_id, pool_name, get_pool(pool_name));
}
+ MOCK_METHOD2(blacklist_add, int(const std::string& client_address,
+ uint32_t expire_seconds));
+ int do_blacklist_add(const std::string& client_address,
+ uint32_t expire_seconds) {
+ return TestMemRadosClient::blacklist_add(client_address, expire_seconds);
+ }
+
void default_to_dispatch() {
using namespace ::testing;
ON_CALL(*this, create_ioctx(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_create_ioctx));
+ ON_CALL(*this, blacklist_add(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_blacklist_add));
}
};