From 9ffd464dac102f684d6dfa78e58d2cb45e165ed6 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 12 Apr 2017 10:47:28 -0400 Subject: [PATCH] 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 --- src/test/librados_test_stub/LibradosTestStub.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index bd69ca234a7d9..dcbc8e25f7d08 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) { -- 2.39.5