diff options
Diffstat (limited to 'src/test')
66 files changed, 97 insertions, 191 deletions
diff --git a/src/test/ObjectMap/test_keyvaluedb_iterators.cc b/src/test/ObjectMap/test_keyvaluedb_iterators.cc index 15ee1f5b36a..061639ad946 100644 --- a/src/test/ObjectMap/test_keyvaluedb_iterators.cc +++ b/src/test/ObjectMap/test_keyvaluedb_iterators.cc @@ -1739,8 +1739,7 @@ TEST_F(EmptyStore, UpperBoundMockDB) int main(int argc, char *argv[]) { - vector<const char*> args; - argv_to_vec(argc, (const char **) argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/ObjectMap/test_object_map.cc b/src/test/ObjectMap/test_object_map.cc index db19c17e8cd..1410b39b056 100644 --- a/src/test/ObjectMap/test_object_map.cc +++ b/src/test/ObjectMap/test_object_map.cc @@ -657,8 +657,7 @@ public: int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/TestSignalHandlers.cc b/src/test/TestSignalHandlers.cc index a1344e06fae..fb307ed9bdf 100644 --- a/src/test/TestSignalHandlers.cc +++ b/src/test/TestSignalHandlers.cc @@ -77,8 +77,7 @@ typedef void (*test_fn_t)(void); int main(int argc, const char **argv) { - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); if (args.empty()) { cerr << argv[0] << ": -h or --help for usage" << std::endl; exit(1); diff --git a/src/test/TestTimers.cc b/src/test/TestTimers.cc index 98cb4f927b7..78bdfd3a41b 100644 --- a/src/test/TestTimers.cc +++ b/src/test/TestTimers.cc @@ -246,10 +246,9 @@ static int safe_timer_cancellation_test(SafeTimer &safe_timer, int main(int argc, const char **argv) { - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/bench_log.cc b/src/test/bench_log.cc index e4855521bee..60fda462e87 100644 --- a/src/test/bench_log.cc +++ b/src/test/bench_log.cc @@ -50,8 +50,7 @@ int main(int argc, const char **argv) cout << threads << " threads, " << num << " lines per thread" << std::endl; - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_OSD, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/client/main.cc b/src/test/client/main.cc index b85399774f3..dcd48acbbb2 100644 --- a/src/test/client/main.cc +++ b/src/test/client/main.cc @@ -21,8 +21,7 @@ int main(int argc, char **argv) { - std::vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); [[maybe_unused]] auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/src/test/common/get_command_descriptions.cc b/src/test/common/get_command_descriptions.cc index b83605ec9bf..88bc181912f 100644 --- a/src/test/common/get_command_descriptions.cc +++ b/src/test/common/get_command_descriptions.cc @@ -97,8 +97,7 @@ static void pull585() } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/daemon_config.cc b/src/test/daemon_config.cc index f1e7945fe8e..c9afe54837a 100644 --- a/src/test/daemon_config.cc +++ b/src/test/daemon_config.cc @@ -131,8 +131,7 @@ TEST(DaemonConfig, ArgV) { const char *argv[] = { "foo", "--log-graylog-port", "22", "--key", "my-key", NULL }; size_t argc = (sizeof(argv) / sizeof(argv[0])) - 1; - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); g_ceph_context->_conf.parse_argv(args); g_ceph_context->_conf.apply_changes(nullptr); diff --git a/src/test/direct_messenger/test_direct_messenger.cc b/src/test/direct_messenger/test_direct_messenger.cc index 77093f13e47..311fce161d6 100644 --- a/src/test/direct_messenger/test_direct_messenger.cc +++ b/src/test/direct_messenger/test_direct_messenger.cc @@ -424,8 +424,7 @@ TEST(DirectMessenger, StartWithoutPeer) int main(int argc, char **argv) { // command-line arguments - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_ANY, CODE_ENVIRONMENT_DAEMON, diff --git a/src/test/erasure-code/TestErasureCodeShec_all.cc b/src/test/erasure-code/TestErasureCodeShec_all.cc index 9ee648aac12..401b8affc71 100644 --- a/src/test/erasure-code/TestErasureCodeShec_all.cc +++ b/src/test/erasure-code/TestErasureCodeShec_all.cc @@ -293,8 +293,7 @@ int main(int argc, char **argv) } } - vector<const char*> args; - argv_to_vec(argc, (const char **) argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/erasure-code/TestErasureCodeShec_arguments.cc b/src/test/erasure-code/TestErasureCodeShec_arguments.cc index 8e3c52a19c0..bd387654ff5 100644 --- a/src/test/erasure-code/TestErasureCodeShec_arguments.cc +++ b/src/test/erasure-code/TestErasureCodeShec_arguments.cc @@ -369,10 +369,7 @@ TEST(ParameterTest, combination_all) int main(int argc, char **argv) { - int r; - - vector<const char*> args; - argv_to_vec(argc, (const char **) argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, @@ -383,7 +380,7 @@ int main(int argc, char **argv) create_table_shec432(); - r = RUN_ALL_TESTS(); + int r = RUN_ALL_TESTS(); std::cout << "minimum_to_decode:total_num = " << count_num << std::endl; diff --git a/src/test/filestore/TestFileStore.cc b/src/test/filestore/TestFileStore.cc index 1ae9849e4b2..02bc549e108 100644 --- a/src/test/filestore/TestFileStore.cc +++ b/src/test/filestore/TestFileStore.cc @@ -67,10 +67,9 @@ TEST(FileStore, create) } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/journal/test_main.cc b/src/test/journal/test_main.cc index afb535d3111..d0131ae046d 100644 --- a/src/test/journal/test_main.cc +++ b/src/test/journal/test_main.cc @@ -13,10 +13,9 @@ int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); - std::vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_OSD, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_OSD, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_MON_CONFIG); g_conf().set_val("lockdep", "true"); diff --git a/src/test/kv_store_bench.cc b/src/test/kv_store_bench.cc index bc35346e41d..f5de5a9117a 100644 --- a/src/test/kv_store_bench.cc +++ b/src/test/kv_store_bench.cc @@ -55,8 +55,7 @@ KvStoreBench::~KvStoreBench() } int KvStoreBench::setup(int argc, const char** argv) { - vector<const char*> args; - argv_to_vec(argc,argv,args); + auto args = argv_to_vec(argc, argv); srand(time(NULL)); stringstream help; diff --git a/src/test/libcephsqlite/main.cc b/src/test/libcephsqlite/main.cc index 28ab88e7cb9..40bab659cf3 100644 --- a/src/test/libcephsqlite/main.cc +++ b/src/test/libcephsqlite/main.cc @@ -1093,8 +1093,7 @@ out: int main(int argc, char **argv) { - std::vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); std::string conf_file_list; std::string cluster; diff --git a/src/test/librados/asio.cc b/src/test/librados/asio.cc index 12d56e85c69..f92c42c72a5 100644 --- a/src/test/librados/asio.cc +++ b/src/test/librados/asio.cc @@ -358,8 +358,7 @@ TEST_F(AsioRados, AsyncWriteOperationYield) int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, diff --git a/src/test/librgw_file.cc b/src/test/librgw_file.cc index b206f24932c..9dc9541acaa 100644 --- a/src/test/librgw_file.cc +++ b/src/test/librgw_file.cc @@ -242,14 +242,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -259,6 +255,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_aw.cc b/src/test/librgw_file_aw.cc index 224366b4360..11c81ad7fd4 100644 --- a/src/test/librgw_file_aw.cc +++ b/src/test/librgw_file_aw.cc @@ -367,14 +367,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -384,6 +380,8 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; + for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_cd.cc b/src/test/librgw_file_cd.cc index 8bbe350ac24..e0f18022e10 100644 --- a/src/test/librgw_file_cd.cc +++ b/src/test/librgw_file_cd.cc @@ -138,14 +138,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -155,6 +151,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_gp.cc b/src/test/librgw_file_gp.cc index 757fdfd8da2..56b61dce4be 100644 --- a/src/test/librgw_file_gp.cc +++ b/src/test/librgw_file_gp.cc @@ -439,14 +439,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -456,6 +452,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_marker.cc b/src/test/librgw_file_marker.cc index 3e2bce95e78..9095fd9bfcf 100644 --- a/src/test/librgw_file_marker.cc +++ b/src/test/librgw_file_marker.cc @@ -427,14 +427,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -444,6 +440,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_nfsns.cc b/src/test/librgw_file_nfsns.cc index eb48a1ee71c..c1e9c35c58b 100644 --- a/src/test/librgw_file_nfsns.cc +++ b/src/test/librgw_file_nfsns.cc @@ -1114,14 +1114,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -1131,6 +1127,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/librgw_file_xattr.cc b/src/test/librgw_file_xattr.cc index 73902c4810b..13c75becc2e 100644 --- a/src/test/librgw_file_xattr.cc +++ b/src/test/librgw_file_xattr.cc @@ -371,14 +371,10 @@ TEST(LibRGW, SHUTDOWN) { int main(int argc, char *argv[]) { - char *v{nullptr}; - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - v = getenv("AWS_ACCESS_KEY_ID"); + char* v = getenv("AWS_ACCESS_KEY_ID"); if (v) { access_key = v; } @@ -388,6 +384,7 @@ int main(int argc, char *argv[]) secret_key = v; } + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/mon/test-mon-msg.cc b/src/test/mon/test-mon-msg.cc index 4a05876154e..1ec328d1f73 100644 --- a/src/test/mon/test-mon-msg.cc +++ b/src/test/mon/test-mon-msg.cc @@ -325,8 +325,7 @@ TEST_F(MonMsgTest, MMonJoin) int main(int argc, char *argv[]) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/mon/test_mon_workloadgen.cc b/src/test/mon/test_mon_workloadgen.cc index 147ea8bcd04..e62c5627b40 100644 --- a/src/test/mon/test_mon_workloadgen.cc +++ b/src/test/mon/test_mon_workloadgen.cc @@ -990,11 +990,10 @@ int get_id_interval(int &first, int &last, string &str) int main(int argc, const char *argv[]) { - vector<const char*> args; our_name = argv[0]; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_OSD, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/msgr/perf_msgr_client.cc b/src/test/msgr/perf_msgr_client.cc index 0e5c5ab367f..20fff879bfd 100644 --- a/src/test/msgr/perf_msgr_client.cc +++ b/src/test/msgr/perf_msgr_client.cc @@ -177,8 +177,7 @@ void usage(const string &name) { int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/msgr/perf_msgr_server.cc b/src/test/msgr/perf_msgr_server.cc index f17f90f6d08..aec5923fcbf 100644 --- a/src/test/msgr/perf_msgr_server.cc +++ b/src/test/msgr/perf_msgr_server.cc @@ -144,8 +144,7 @@ void usage(const string &name) { int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/msgr/test_frames_v2.cc b/src/test/msgr/test_frames_v2.cc index cbcf6cab48d..b164ceb4ad2 100644 --- a/src/test/msgr/test_frames_v2.cc +++ b/src/test/msgr/test_frames_v2.cc @@ -469,10 +469,9 @@ INSTANTIATE_TEST_SUITE_P( } // namespace ceph::msgr::v2 int main(int argc, char* argv[]) { - vector<const char*> args; - argv_to_vec(argc, (const char**)argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/msgr/test_msgr.cc b/src/test/msgr/test_msgr.cc index 68133224c21..d2af3ab66be 100644 --- a/src/test/msgr/test_msgr.cc +++ b/src/test/msgr/test_msgr.cc @@ -2340,8 +2340,7 @@ INSTANTIATE_TEST_SUITE_P( ); int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/neorados/list_pool.cc b/src/test/neorados/list_pool.cc index 86039204070..ae36c36e655 100644 --- a/src/test/neorados/list_pool.cc +++ b/src/test/neorados/list_pool.cc @@ -127,8 +127,7 @@ int main(int argc, char** argv) { using namespace std::literals; - std::vector<const char*> args; - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, diff --git a/src/test/neorados/start_stop.cc b/src/test/neorados/start_stop.cc index a2475e31180..4ea0ae5644f 100644 --- a/src/test/neorados/start_stop.cc +++ b/src/test/neorados/start_stop.cc @@ -30,11 +30,10 @@ int main(int argc, char** argv) { using namespace std::literals; - std::vector<const char*> args; - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0); common_init_finish(cct.get()); diff --git a/src/test/objectstore/ObjectStoreTransactionBenchmark.cc b/src/test/objectstore/ObjectStoreTransactionBenchmark.cc index 414608e0420..e2ce3b2ef08 100644 --- a/src/test/objectstore/ObjectStoreTransactionBenchmark.cc +++ b/src/test/objectstore/ObjectStoreTransactionBenchmark.cc @@ -241,8 +241,7 @@ void usage(const string &name) { int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/objectstore/chain_xattr.cc b/src/test/objectstore/chain_xattr.cc index c7bf09e7e92..a0db4e153d5 100644 --- a/src/test/objectstore/chain_xattr.cc +++ b/src/test/objectstore/chain_xattr.cc @@ -437,10 +437,9 @@ TEST(chain_xattr, skip_chain_cleanup_and_ensure_single_attr) } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 16133241fd7..fa4fb69e62e 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -9387,9 +9387,7 @@ TEST_P(StoreTestSpecificAUSize, Ticket45195Repro) { #endif // WITH_BLUESTORE int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/objectstore/test_bdev.cc b/src/test/objectstore/test_bdev.cc index e5e591a38c4..628b586bc2f 100755 --- a/src/test/objectstore/test_bdev.cc +++ b/src/test/objectstore/test_bdev.cc @@ -92,9 +92,7 @@ TEST(KernelDevice, Ticket45337) { } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); map<string,string> defaults = { { "debug_bdev", "1/20" } }; diff --git a/src/test/objectstore/test_bluefs.cc b/src/test/objectstore/test_bluefs.cc index 1de92744868..d868c876e1e 100644 --- a/src/test/objectstore/test_bluefs.cc +++ b/src/test/objectstore/test_bluefs.cc @@ -829,9 +829,7 @@ TEST(BlueFS, test_tracker_50965) { } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); map<string,string> defaults = { { "debug_bluefs", "1/20" }, { "debug_bdev", "1/20" } diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index e3b14f9c272..c8a62a12527 100644 --- a/src/test/objectstore/test_bluestore_types.cc +++ b/src/test/objectstore/test_bluestore_types.cc @@ -1691,8 +1691,7 @@ TEST(bluestore_blob_t, unused) } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/objectstore/test_idempotent.cc b/src/test/objectstore/test_idempotent.cc index 267f4e7c96b..a2af4073ee5 100644 --- a/src/test/objectstore/test_idempotent.cc +++ b/src/test/objectstore/test_idempotent.cc @@ -41,9 +41,7 @@ typename T::iterator rand_choose(T &cont) { } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/objectstore/test_idempotent_sequence.cc b/src/test/objectstore/test_idempotent_sequence.cc index de053859e7a..cac395c36fc 100644 --- a/src/test/objectstore/test_idempotent_sequence.cc +++ b/src/test/objectstore/test_idempotent_sequence.cc @@ -212,9 +212,8 @@ int run_command(std::string& command, std::vector<std::string>& args) int main(int argc, const char *argv[]) { - vector<const char*> args; our_name = argv[0]; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/objectstore/test_kv.cc b/src/test/objectstore/test_kv.cc index 1de904adc23..5917f140b10 100644 --- a/src/test/objectstore/test_kv.cc +++ b/src/test/objectstore/test_kv.cc @@ -1289,9 +1289,7 @@ INSTANTIATE_TEST_SUITE_P( "Betelgeuse(3) D(3)")); int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/objectstore/test_memstore_clone.cc b/src/test/objectstore/test_memstore_clone.cc index 2a0ea093f86..507f74d22d2 100644 --- a/src/test/objectstore/test_memstore_clone.cc +++ b/src/test/objectstore/test_memstore_clone.cc @@ -191,9 +191,7 @@ int main(int argc, char** argv) { "memstore_page_size", "4" } }; - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/objectstore_bench.cc b/src/test/objectstore_bench.cc index da29599cf83..65a2987d08d 100644 --- a/src/test/objectstore_bench.cc +++ b/src/test/objectstore_bench.cc @@ -149,11 +149,8 @@ void osbench_worker(ObjectStore *os, const Config &cfg, int main(int argc, const char *argv[]) { - Config cfg; - // command-line arguments - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); if (args.empty()) { cerr << argv[0] << ": -h or --help for usage" << std::endl; @@ -168,6 +165,7 @@ int main(int argc, const char *argv[]) CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); + Config cfg; std::string val; vector<const char*>::iterator i = args.begin(); while (i != args.end()) { diff --git a/src/test/omap_bench.cc b/src/test/omap_bench.cc index e34387d72ae..714774f12c5 100644 --- a/src/test/omap_bench.cc +++ b/src/test/omap_bench.cc @@ -31,8 +31,7 @@ using ceph::bufferlist; int OmapBench::setup(int argc, const char** argv) { //parse key_value_store_bench args - vector<const char*> args; - argv_to_vec(argc,argv,args); + auto args = argv_to_vec(argc, argv); for (unsigned i = 0; i < args.size(); i++) { if(i < args.size() - 1) { if (strcmp(args[i], "-t") == 0) { diff --git a/src/test/os/TestLFNIndex.cc b/src/test/os/TestLFNIndex.cc index 053af6db22a..c0976fcf1a9 100644 --- a/src/test/os/TestLFNIndex.cc +++ b/src/test/os/TestLFNIndex.cc @@ -472,8 +472,7 @@ int main(int argc, char **argv) { if (ret < 0) { cerr << "SKIP LFNIndex because unable to test for xattr" << std::endl; } else { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/osd/ceph_test_osd_stale_read.cc b/src/test/osd/ceph_test_osd_stale_read.cc index 5623d47f65e..7ee1255ed0f 100644 --- a/src/test/osd/ceph_test_osd_stale_read.cc +++ b/src/test/osd/ceph_test_osd_stale_read.cc @@ -168,9 +168,8 @@ TEST(OSD, StaleRead) { } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto args = argv_to_vec(argc, argv); + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0); common_init_finish(g_ceph_context); ::testing::InitGoogleTest(&argc, argv); diff --git a/src/test/osdc/object_cacher_stress.cc b/src/test/osdc/object_cacher_stress.cc index f69905017f1..096f9b49ebf 100644 --- a/src/test/osdc/object_cacher_stress.cc +++ b/src/test/osdc/object_cacher_stress.cc @@ -353,9 +353,8 @@ int correctness_test(uint64_t delay_ns) int main(int argc, const char **argv) { - std::vector<const char*> args; - argv_to_vec(argc, argv, args); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto args = argv_to_vec(argc, argv); + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/perf_local.cc b/src/test/perf_local.cc index 460411fc0d5..6c733acf9e8 100644 --- a/src/test/perf_local.cc +++ b/src/test/perf_local.cc @@ -1033,8 +1033,7 @@ void run_test(TestInfo& info) int main(int argc, char *argv[]) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/rbd_mirror/random_write.cc b/src/test/rbd_mirror/random_write.cc index 4a473ed3466..cf5315048f0 100644 --- a/src/test/rbd_mirror/random_write.cc +++ b/src/test/rbd_mirror/random_write.cc @@ -150,8 +150,7 @@ void write_image(librbd::Image &image) { int main(int argc, const char **argv) { - std::vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); if (args.empty()) { std::cerr << argv[0] << ": -h or --help for usage" << std::endl; exit(1); @@ -161,7 +160,7 @@ int main(int argc, const char **argv) exit(0); } - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_MON_CONFIG); diff --git a/src/test/rgw/test_http_manager.cc b/src/test/rgw/test_http_manager.cc index 599266731d8..418c6da022c 100644 --- a/src/test/rgw/test_http_manager.cc +++ b/src/test/rgw/test_http_manager.cc @@ -105,9 +105,7 @@ TEST(HTTPManager, SignalThread) int main(int argc, char** argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/rgw/test_rgw_crypto.cc b/src/test/rgw/test_rgw_crypto.cc index edf24f41bb6..bff15deb5d0 100644 --- a/src/test/rgw/test_rgw_crypto.cc +++ b/src/test/rgw/test_rgw_crypto.cc @@ -797,9 +797,7 @@ TEST(TestRGWCrypto, verify_Encrypt_Decrypt) int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/rgw/test_rgw_manifest.cc b/src/test/rgw/test_rgw_manifest.cc index 8ccf17c9471..ee92248d008 100644 --- a/src/test/rgw/test_rgw_manifest.cc +++ b/src/test/rgw/test_rgw_manifest.cc @@ -386,9 +386,7 @@ TEST(TestRGWManifest, old_obj_manifest) { int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/rgw/test_rgw_period_history.cc b/src/test/rgw/test_rgw_period_history.cc index 39c173ac430..a3589934f44 100644 --- a/src/test/rgw/test_rgw_period_history.cc +++ b/src/test/rgw/test_rgw_period_history.cc @@ -325,9 +325,7 @@ TEST(PeriodHistory, AttachAfter) int main(int argc, char** argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); - + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/test_c2c.cc b/src/test/test_c2c.cc index a8b12dadd41..5fe1ac2f1fc 100644 --- a/src/test/test_c2c.cc +++ b/src/test/test_c2c.cc @@ -34,8 +34,7 @@ void sigterm_handler(int signum) int main(int argc, const char **argv) { int ret = 0; - std::vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); diff --git a/src/test/test_cors.cc b/src/test/test_cors.cc index 9cb735b5c1a..2df022f80a3 100644 --- a/src/test/test_cors.cc +++ b/src/test/test_cors.cc @@ -869,8 +869,7 @@ TEST(TestCORS, deletecors_test){ } int main(int argc, char *argv[]){ - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/test_features.cc b/src/test/test_features.cc index 5a13647e9f1..1ae758bfb34 100644 --- a/src/test/test_features.cc +++ b/src/test/test_features.cc @@ -35,10 +35,9 @@ TEST(features, release_from_features) { int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, + auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); common_init_finish(g_ceph_context); diff --git a/src/test/test_filejournal.cc b/src/test/test_filejournal.cc index 356b1932328..f985b2c155a 100644 --- a/src/test/test_filejournal.cc +++ b/src/test/test_filejournal.cc @@ -64,8 +64,7 @@ unsigned size_mb = 200; const char GTEST_PRFIX[] = "--gtest_"; int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/test_mempool.cc b/src/test/test_mempool.cc index 4b8c144be23..9dd96682f36 100644 --- a/src/test/test_mempool.cc +++ b/src/test/test_mempool.cc @@ -436,8 +436,7 @@ TEST(mempool, check_shard_select) int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/test_mutate.cc b/src/test/test_mutate.cc index 98841e7cc09..04475f6174d 100644 --- a/src/test/test_mutate.cc +++ b/src/test/test_mutate.cc @@ -40,9 +40,7 @@ static void usage(void) int main(int argc, const char **argv) { - int ret = 0; - std::vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, CINIT_FLAG_NO_DEFAULT_CONFIG_FILE); @@ -83,6 +81,7 @@ int main(int argc, const char **argv) return 1; } + int ret = 0; librados::ObjectWriteOperation o; IoCtx ioctx; if (rados.pool_lookup(pool_name.c_str()) <= 0) { diff --git a/src/test/test_rgw_admin_log.cc b/src/test/test_rgw_admin_log.cc index 2238c8097bb..73767663916 100644 --- a/src/test/test_rgw_admin_log.cc +++ b/src/test/test_rgw_admin_log.cc @@ -1560,8 +1560,7 @@ TEST(TestRGWAdmin, bilog_trim) { } int main(int argc, char *argv[]){ - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/test_rgw_admin_meta.cc b/src/test/test_rgw_admin_meta.cc index 7dc96b61ca1..734836782e0 100644 --- a/src/test/test_rgw_admin_meta.cc +++ b/src/test/test_rgw_admin_meta.cc @@ -894,8 +894,7 @@ TEST(TestRGWAdmin, meta_delete){ } int main(int argc, char *argv[]){ - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/test_rgw_ldap.cc b/src/test/test_rgw_ldap.cc index 0369c933909..007f7db301f 100644 --- a/src/test/test_rgw_ldap.cc +++ b/src/test/test_rgw_ldap.cc @@ -86,12 +86,10 @@ TEST(RGW_LDAP, SHUTDOWN) { int main(int argc, char *argv[]) { - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_witharg(args, arg_iter, &val, "--access", (char*) nullptr)) { diff --git a/src/test/test_rgw_token.cc b/src/test/test_rgw_token.cc index 321e26fcc9c..f2defbf3051 100644 --- a/src/test/test_rgw_token.cc +++ b/src/test/test_rgw_token.cc @@ -106,12 +106,10 @@ TEST(TOKEN, SHUTDOWN) { int main(int argc, char *argv[]) { - string val; - vector<const char*> args; - - argv_to_vec(argc, const_cast<const char**>(argv), args); + auto args = argv_to_vec(argc, argv); env_to_vec(args); + string val; for (auto arg_iter = args.begin(); arg_iter != args.end();) { if (ceph_argparse_flag(args, arg_iter, "--verbose", (char*) nullptr)) { diff --git a/src/test/test_trans.cc b/src/test/test_trans.cc index 98e407927e4..2ac4463035d 100644 --- a/src/test/test_trans.cc +++ b/src/test/test_trans.cc @@ -37,8 +37,7 @@ struct Foo : public Thread { int main(int argc, const char **argv) { - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/testkeys.cc b/src/test/testkeys.cc index 3ad794f5eda..85d0b56676f 100644 --- a/src/test/testkeys.cc +++ b/src/test/testkeys.cc @@ -12,8 +12,7 @@ using namespace std; int main(int argc, const char **argv) { - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/testmsgr.cc b/src/test/testmsgr.cc index 3ff2ed7de9c..ae162a290cc 100644 --- a/src/test/testmsgr.cc +++ b/src/test/testmsgr.cc @@ -69,8 +69,7 @@ private: int main(int argc, const char **argv, const char *envp[]) { - vector<const char*> args; - argv_to_vec(argc, argv, args); + auto args = argv_to_vec(argc, argv); auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, diff --git a/src/test/xattr_bench.cc b/src/test/xattr_bench.cc index 7fac235be49..423e6a8c890 100644 --- a/src/test/xattr_bench.cc +++ b/src/test/xattr_bench.cc @@ -144,8 +144,7 @@ uint64_t do_run(ObjectStore *store, int attrsize, int numattrs, } int main(int argc, char **argv) { - vector<const char*> args; - argv_to_vec(argc, (const char **)argv, args); + auto args = argv_to_vec(argc, argv); if (args.empty()) { cerr << argv[0] << ": -h or --help for usage" << std::endl; exit(1); |