From: Jason Dillaman Date: Wed, 12 Apr 2017 14:47:28 +0000 (-0400) Subject: test/librados_test_stub: fixed cls_cxx_map_get_keys/vals return value X-Git-Tag: v12.0.2~89^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ffd464dac102f684d6dfa78e58d2cb45e165ed6;p=ceph.git test/librados_test_stub: fixed cls_cxx_map_get_keys/vals return value Fixes: http://tracker.ceph.com/issues/19597 Signed-off-by: Jason Dillaman --- diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index bd69ca234a7d..dcbc8e25f7d0 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -1130,7 +1130,7 @@ int cls_cxx_map_get_keys(cls_method_context_t hctx, const string &start_obj, keys->insert(last_key); } } while (!vals.empty()); - return 0; + return keys->size(); } int cls_cxx_map_get_val(cls_method_context_t hctx, const string &key, @@ -1158,8 +1158,12 @@ int cls_cxx_map_get_vals(cls_method_context_t hctx, const string &start_obj, std::map *vals) { librados::TestClassHandler::MethodContext *ctx = reinterpret_cast(hctx); - return ctx->io_ctx_impl->omap_get_vals(ctx->oid, start_obj, filter_prefix, - max_to_get, vals); + int r = ctx->io_ctx_impl->omap_get_vals(ctx->oid, start_obj, filter_prefix, + max_to_get, vals); + if (r < 0) { + return r; + } + return vals->size(); } int cls_cxx_map_remove_key(cls_method_context_t hctx, const string &key) {