]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: : build without "using namespace std"
authorKefu Chai <kchai@redhat.com>
Wed, 11 Aug 2021 03:53:01 +0000 (11:53 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Aug 2021 04:23:36 +0000 (12:23 +0800)
* add "std::" prefix in headers
* add "using" declarations in .cc files.

so we don't rely on "using namespace std" in one or more included
headers.

Signed-off-by: Kefu Chai <kchai@redhat.com>
116 files changed:
src/log/test.cc
src/test/ObjectMap/KeyValueDBMemory.h
src/test/TestSignalHandlers.cc
src/test/TestTimers.cc
src/test/admin_socket.cc
src/test/admin_socket_output.cc
src/test/base64.cc
src/test/bench_log.cc
src/test/bufferlist.cc
src/test/ceph_argparse.cc
src/test/ceph_compatset.cc
src/test/client/alternate_name.cc
src/test/client/main.cc
src/test/cls_2pc_queue/test_cls_2pc_queue.cc
src/test/cls_cas/test_cls_cas.cc
src/test/cls_fifo/bench_cls_fifo.cc
src/test/cls_fifo/test_cls_fifo.cc
src/test/cls_lock/test_cls_lock.cc
src/test/cls_log/test_cls_log.cc
src/test/cls_lua/test_cls_lua.cc
src/test/cls_queue/test_cls_queue.cc
src/test/cls_refcount/test_cls_refcount.cc
src/test/cls_rgw/test_cls_rgw.cc
src/test/cls_rgw_gc/test_cls_rgw_gc.cc
src/test/cls_version/test_cls_version.cc
src/test/compressor/compressor_plugin_example.cc
src/test/compressor/test_compression.cc
src/test/confutils.cc
src/test/crush/CrushWrapper.cc
src/test/crush/crush.cc
src/test/crypto.cc
src/test/daemon_config.cc
src/test/filestore/TestFileStore.cc
src/test/fio/fio_ceph_messenger.cc
src/test/fio/fio_ceph_objectstore.cc
src/test/fs/test_ino_release_cb.cc
src/test/immutable_object_cache/test_multi_session.cc
src/test/journal/RadosTestFixture.cc
src/test/journal/test_JournalPlayer.cc
src/test/journal/test_ObjectRecorder.cc
src/test/libcephfs/access.cc
src/test/libcephfs/monconfig.cc
src/test/libcephfs/test.cc
src/test/librados/aio_cxx.cc
src/test/librados/asio.cc
src/test/librados/cmd.cc
src/test/librados/list.cc
src/test/librados/misc.cc
src/test/librados/misc_cxx.cc
src/test/librados/service.cc
src/test/librados/service_cxx.cc
src/test/librados/test_common.cc
src/test/librados/tier_cxx.cc
src/test/librados_test_stub/LibradosTestStub.cc
src/test/librados_test_stub/TestIoCtxImpl.cc
src/test/librgw_file.cc
src/test/librgw_file_aw.cc
src/test/librgw_file_cd.cc
src/test/librgw_file_gp.cc
src/test/librgw_file_marker.cc
src/test/librgw_file_nfsns.cc
src/test/librgw_file_xattr.cc
src/test/mds/TestMDSAuthCaps.cc
src/test/mgr/test_mgrcap.cc
src/test/mon/PGMap.cc
src/test/mon/moncap.cc
src/test/mon/test-mon-msg.cc
src/test/msgr/test_async_driver.cc
src/test/msgr/test_async_networkstack.cc
src/test/msgr/test_frames_v2.cc
src/test/msgr/test_msgr.cc
src/test/objectstore/Allocator_bench.cc
src/test/objectstore/DeterministicOpSequence.cc
src/test/objectstore/DeterministicOpSequence.h
src/test/objectstore/FileStoreDiff.cc
src/test/objectstore/FileStoreTracker.cc
src/test/objectstore/FileStoreTracker.h
src/test/objectstore/TestObjectStoreState.cc
src/test/objectstore/TestObjectStoreState.h
src/test/objectstore/allocator_replay_test.cc
src/test/objectstore/test_idempotent.cc
src/test/objectstore/test_idempotent_sequence.cc
src/test/objectstore/test_kv.cc
src/test/objectstore_bench.cc
src/test/omap_bench.h
src/test/osd/TestECBackend.cc
src/test/osd/TestOpStat.h
src/test/osd/TestPGLog.cc
src/test/osd/ceph_test_osd_stale_read.cc
src/test/osd/osdcap.cc
src/test/osd/test_extent_cache.cc
src/test/osd/test_pg_transaction.cc
src/test/osd/types.cc
src/test/osdc/object_cacher_stress.cc
src/test/perf_counters.cc
src/test/perf_local.cc
src/test/rbd_mirror/random_write.cc
src/test/rgw/test_cls_fifo_legacy.cc
src/test/rgw/test_log_backing.cc
src/test/rgw/test_rgw_common.h
src/test/test_addrs.cc
src/test/test_c2c.cc
src/test/test_denc.cc
src/test/test_features.cc
src/test/test_filejournal.cc
src/test/test_ipaddr.cc
src/test/test_mempool.cc
src/test/test_mutate.cc
src/test/test_rgw_ldap.cc
src/test/test_rgw_token.cc
src/test/test_striper.cc
src/test/test_trans.cc
src/test/test_utime.cc
src/test/test_workqueue.cc
src/test/testcrypto.cc
src/test/testkeys.cc

index a2169543b162f0af93be53531d63fd1c15e59a4d..4d11f73a0fa8e289c6036143def8f3b4b3bf48cd 100644 (file)
@@ -10,6 +10,7 @@
 #include "global/global_context.h"
 #include "common/dout.h"
 
+using namespace std;
 using namespace ceph::logging;
 
 TEST(Log, Simple)
index 5e7d3f0e1675f33f7c171ba1ce8d5df5672e3577..de84ede9049f878a31befbdd8d4c8c4f92cd0cf5 100644 (file)
@@ -24,47 +24,47 @@ public:
   int open(std::ostream &out, const std::string& cfs="") override {
     return 0;
   }
-  int create_and_open(ostream &out, const std::string& cfs="") override {
+  int create_and_open(std::ostream &out, const std::string& cfs="") override {
     return 0;
   }
 
   int get(
-    const string &prefix,
-    const std::set<string> &key,
-    std::map<string, bufferlist> *out
+    const std::string &prefix,
+    const std::set<std::string> &key,
+    std::map<std::string, bufferlist> *out
     ) override;
   using KeyValueDB::get;
 
   int get_keys(
-    const string &prefix,
-    const std::set<string> &key,
-    std::set<string> *out
+    const std::string &prefix,
+    const std::set<std::string> &key,
+    std::set<std::string> *out
     );
 
   int set(
-    const string &prefix,
-    const string &key,
+    const std::string &prefix,
+    const std::string &key,
     const bufferlist &bl
     );
 
   int rmkey(
-    const string &prefix,
-    const string &key
+    const std::string &prefix,
+    const std::string &key
     );
 
   int rmkeys_by_prefix(
-    const string &prefix
+    const std::string &prefix
     );
 
   int rm_range_keys(
-      const string &prefix,
-      const string &start,
-      const string &end
+      const std::string &prefix,
+      const std::string &start,
+      const std::string &end
       );
 
   class TransactionImpl_ : public TransactionImpl {
   public:
-    list<Context *> on_commit;
+    std::list<Context *> on_commit;
     KeyValueDBMemory *db;
 
     explicit TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
@@ -72,10 +72,10 @@ public:
 
     struct SetOp : public Context {
       KeyValueDBMemory *db;
-      std::pair<string,string> key;
+      std::pair<std::string,std::string> key;
       bufferlist value;
       SetOp(KeyValueDBMemory *db,
-           const std::pair<string,string> &key,
+           const std::pair<std::string,std::string> &key,
            const bufferlist &value)
        : db(db), key(key), value(value) {}
       void finish(int r) override {
@@ -83,15 +83,15 @@ public:
       }
     };
 
-    void set(const string &prefix, const string &k, const bufferlist& bl) override {
+    void set(const std::string &prefix, const std::string &k, const bufferlist& bl) override {
       on_commit.push_back(new SetOp(db, std::make_pair(prefix, k), bl));
     }
 
     struct RmKeysOp : public Context {
       KeyValueDBMemory *db;
-      std::pair<string,string> key;
+      std::pair<std::string,std::string> key;
       RmKeysOp(KeyValueDBMemory *db,
-              const std::pair<string,string> &key)
+              const std::pair<std::string,std::string> &key)
        : db(db), key(key) {}
       void finish(int r) override {
        db->rmkey(key.first, key.second);
@@ -100,40 +100,40 @@ public:
 
     using KeyValueDB::TransactionImpl::rmkey;
     using KeyValueDB::TransactionImpl::set;
-    void rmkey(const string &prefix, const string &key) override {
+    void rmkey(const std::string &prefix, const std::string &key) override {
       on_commit.push_back(new RmKeysOp(db, std::make_pair(prefix, key)));
     }
 
     struct RmKeysByPrefixOp : public Context {
       KeyValueDBMemory *db;
-      string prefix;
+      std::string prefix;
       RmKeysByPrefixOp(KeyValueDBMemory *db,
-                      const string &prefix)
+                      const std::string &prefix)
        : db(db), prefix(prefix) {}
       void finish(int r) override {
        db->rmkeys_by_prefix(prefix);
       }
     };
-    void rmkeys_by_prefix(const string &prefix) override {
+    void rmkeys_by_prefix(const std::string &prefix) override {
       on_commit.push_back(new RmKeysByPrefixOp(db, prefix));
     }
 
     struct RmRangeKeys: public Context {
       KeyValueDBMemory *db;
-      string prefix, start, end;
-      RmRangeKeys(KeyValueDBMemory *db, const string &prefix, const string &s, const string &e)
+      std::string prefix, start, end;
+      RmRangeKeys(KeyValueDBMemory *db, const std::string &prefix, const std::string &s, const std::string &e)
        : db(db), prefix(prefix), start(s), end(e) {}
       void finish(int r) {
        db->rm_range_keys(prefix, start, end);
       }
     };
 
-    void rm_range_keys(const string &prefix, const string &start, const string &end) {
+    void rm_range_keys(const std::string &prefix, const std::string &start, const std::string &end) {
       on_commit.push_back(new RmRangeKeys(db, prefix, start, end));
     }
 
     int complete() {
-      for (list<Context *>::iterator i = on_commit.begin();
+      for (auto i = on_commit.begin();
           i != on_commit.end();
           on_commit.erase(i++)) {
        (*i)->complete(0);
@@ -142,7 +142,7 @@ public:
     }
 
     ~TransactionImpl_() override {
-      for (list<Context *>::iterator i = on_commit.begin();
+      for (auto i = on_commit.begin();
           i != on_commit.end();
           on_commit.erase(i++)) {
        delete *i;
@@ -158,13 +158,11 @@ public:
     return static_cast<TransactionImpl_*>(trans.get())->complete();
   }
 
-  uint64_t get_estimated_size(map<string,uint64_t> &extras) override {
+  uint64_t get_estimated_size(std::map<std::string,uint64_t> &extras) override {
     uint64_t total_size = 0;
 
-    for (map<pair<string,string>,bufferlist>::iterator p = db.begin();
-         p != db.end(); ++p) {
-      string prefix = p->first.first;
-      bufferlist &bl = p->second;
+    for (auto& [key, bl] : db) {
+      string prefix = key.first;
 
       uint64_t sz = bl.length();
       total_size += sz;
@@ -177,8 +175,8 @@ public:
   }
 
 private:
-  bool exists_prefix(const string &prefix) {
-    std::map<std::pair<string,string>,bufferlist>::iterator it;
+  bool exists_prefix(const std::string &prefix) {
+    std::map<std::pair<std::string,std::string>,bufferlist>::iterator it;
     it = db.lower_bound(std::make_pair(prefix, ""));
     return ((it != db.end()) && ((*it).first.first == prefix));
   }
index 74f819675e6c4ca74b88fa106dbb2a51d4154b57..a1344e06fae6d4fb193eaf5a6c6bfcff342a4014 100644 (file)
@@ -29,7 +29,8 @@
 #include <string>
 
 #define dout_context g_ceph_context
-using std::string;
+
+using namespace std;
 
 // avoid compiler warning about dereferencing NULL pointer
 static int* get_null()
index eaa78f82b6ba82681675bb5b8310bed88a86ac47..98cb4f927b7d5b2e124481c031f3409f7138735d 100644 (file)
@@ -13,6 +13,8 @@
  */
 #define MAX_TEST_CONTEXTS 5
 
+using namespace std;
+
 class TestContext;
 
 namespace
index 859328d9c78c5ea1b388c633610692b8a5ad35f8..69bbcedb3cd4af8a2ac52be2c4d965e02f2ddc96 100644 (file)
@@ -24,6 +24,8 @@
 #include <string>
 #include <sys/un.h>
 
+using namespace std;
+
 class AdminSocketTest
 {
 public:
index b178e3841cd3d93410cbc9cf313c88dd264cce85..1ce69094dd987704d66e9d94162437597577a63b 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "admin_socket_output.h"
 
+using namespace std;
+
 void AdminSocketOutput::add_target(const std::string& target) {
   if (target == "all") {
     add_target("osd");
index 9fcdef41525c1eeb760fb02b24f8bc4d21f63580..48035118a9fa4fdad95dc290fb177fb0b68ed848 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "gtest/gtest.h"
 
+using namespace std;
+
 TEST(RoundTrip, SimpleRoundTrip) {
   static const int OUT_LEN = 4096;
   const char * const original = "abracadabra";
index 205dfe97b622598f2cb7451bad7780f50eb8e8c8..e4855521bee0333ea58c80c7154fe45608b3fbf8 100644 (file)
@@ -11,6 +11,8 @@
 
 #define dout_context g_ceph_context
 
+using namespace std;
+
 struct T : public Thread {
   int num;
   set<int> myset;
index 4d830f6e97e1c7364b2a0c8597520dbc06530a53..3d1f064b2c4dd24fda41c5374dea8f0a262a19d1 100644 (file)
@@ -43,6 +43,8 @@
 #define MAX_TEST 1000000
 #define FILENAME "bufferlist"
 
+using namespace std;
+
 static char cmd[128];
 
 struct instrumented_bptr : public ceph::buffer::ptr {
index ae1461a09405a16088558764d0f4820145a5a82d..738879c5ba8baf4d004c77744462613a31c79c17 100644 (file)
@@ -18,6 +18,8 @@
 #include <vector>
 #include "include/stringify.h"
 
+using namespace std;
+
 /* Holds a std::vector with C-strings.
  * Will free() them properly in the destructor.
  *
index 7b274e2a562530af02977627325fe40076dd5c02..28561bf2b23cb42feb8ef0ffe34ed32708e83d61 100644 (file)
@@ -30,6 +30,8 @@
 #include "gtest/gtest.h"
 #include <vector>
 
+using namespace std;
+
 TEST(CephCompatSet, AllSet) {
   CompatSet::FeatureSet compat;
   CompatSet::FeatureSet ro;
index 7671eff9aecd086bdffe5caed539a78e8bb97f17..43f4280120ca664527951e3f591c67fed28802a8 100644 (file)
@@ -48,7 +48,7 @@ TEST_F(TestClient, AlternateNameMkdir) {
   {
     Client::walk_dentry_result wdr;
     ASSERT_EQ(0, client->walk(dir.c_str(), &wdr, myperm));
-    ASSERT_EQ(wdr.alternate_name, "foo"s);
+    ASSERT_EQ(wdr.alternate_name, "foo");
   }
 
   ASSERT_EQ(0, client->rmdir(dir.c_str(), myperm));
index 437ff722d5deebf3a85bfcf01208c7982096bac6..b85399774f32df0ab58849689ad8c622b053c03c 100644 (file)
@@ -21,7 +21,7 @@
  
 int main(int argc, char **argv)
 {
-  vector<const char*> args;
+  std::vector<const char*> args;
   argv_to_vec(argc, (const char **)argv, args);
   [[maybe_unused]] auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   ::testing::InitGoogleTest(&argc, argv);
index 90a4d2db47fa28e787a40a3502f8aee9d5aecca6..41ebf82daf0ca1d944041b6c4673004ef9852886 100644 (file)
@@ -19,6 +19,8 @@
 #include <chrono>
 #include <atomic>
 
+using namespace std;
+
 class TestCls2PCQueue : public ::testing::Test {
 protected:
   librados::Rados rados;
index b011b4b8eec7c4717edb1754a6fc9f6be8060cde..698eda434ca5e0bad941578c3abcf6329e193b9c 100644 (file)
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+using namespace std;
 
 /// creates a temporary pool and initializes an IoCtx for each test
 class cls_cas : public ::testing::Test {
index df390cd3171252d24baa86962d40f03f50a0f10b..ae4b7e1ae64f9c2ba8bccf060b60409ddf956d82 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "neorados/cls/fifo.h"
 
+using namespace std;
+
 namespace ba = boost::asio;
 namespace bs = boost::system;
 namespace bpo = boost::program_options;
index 484248c0c81ca3178df8ae4c5e234ab9c0f305ff..c7a40413bb87b49e64a83d7e974dd9948b150db9 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "gtest/gtest.h"
 
+using namespace std;
+
 namespace R = neorados;
 namespace ba = boost::asio;
 namespace bs = boost::system;
index 405befa033543b6f2f77edc59f70a77248b79a77..bf09ec592cff0f85520dc7f74156fd35b9532f04 100644 (file)
 #include "test/librados/test_cxx.h"
 #include "gtest/gtest.h"
 
-using namespace librados;
-
 #include "cls/lock/cls_lock_client.h"
 #include "cls/lock/cls_lock_ops.h"
 
+using namespace std;
+using namespace librados;
 using namespace rados::cls::lock;
 
 void lock_info(IoCtx *ioctx, string& oid, string& name, map<locker_id_t, locker_info_t>& lockers,
index 868afcaf65d8f54ee7c7de8a14845742999b794d..016e9d643ee54d96ecf0c4d490ed4f296fe943e0 100644 (file)
@@ -16,6 +16,8 @@
 #include <string>
 #include <vector>
 
+using namespace std;
+
 /// creates a temporary pool and initializes an IoCtx for each test
 class cls_log : public ::testing::Test {
   librados::Rados rados;
index 5a313c12ca6f9144d51b36dd1734075398d97b3e..516b4c9ae00dd7c6b92922e7dd221ae0d791059e 100644 (file)
@@ -7,6 +7,8 @@
 #include "cls/lua/cls_lua_client.h"
 #include "cls/lua/cls_lua.h"
 
+using namespace std;
+
 /*
  * JSON script to test JSON I/O protocol with cls_lua
  */
index 4f0b0d0500392e1f86dd10941c3bdd48dd75b5e7..5dbbccb82fd142b43b71f365e5f911c49a2df5cd 100644 (file)
@@ -18,6 +18,8 @@
 #include <chrono>
 #include <atomic>
 
+using namespace std;
+
 class TestClsQueue : public ::testing::Test {
 protected:
   librados::Rados rados;
index b481ca0f240b6003dd7b5d16531132969d4c9067..ed991820f6ef0998d40700df08a1aa8cb8a2c7f9 100644 (file)
@@ -11,6 +11,8 @@
 #include <string>
 #include <vector>
 
+using namespace std;
+
 static librados::ObjectWriteOperation *new_op() {
   return new librados::ObjectWriteOperation();
 }
index 425123f56e12f213fc40a844077f3d44aa0d22ee..d150097fab4dac7e0fe01fd91a190b85c821b4ac 100644 (file)
@@ -16,6 +16,7 @@
 #include <map>
 #include <set>
 
+using namespace std;
 using namespace librados;
 
 // creates a temporary pool and initializes an IoCtx shared by all tests
index 387083f27fc12aae03701137d1cdc8f989a474e7..129aa3d87357e1a5bc50f62f962194ca1c588986 100644 (file)
@@ -17,6 +17,7 @@
 #include <map>
 #include <set>
 
+using namespace std;
 using namespace librados;
 
 librados::Rados rados;
index 9ecea1f2cd29d06840699eb88cec1323f4ab34c6..3397f14efb627c70d2274c6fb561852959cbf3b6 100644 (file)
@@ -14,6 +14,8 @@
 #include <string>
 #include <vector>
 
+using namespace std;
+
 static librados::ObjectWriteOperation *new_op() {
   return new librados::ObjectWriteOperation();
 }
index 5a6ddd32ebf5787f0f4fd5b921b4b620b6d28370..014f1fb9db629a70165e3ed67a7f195847c08ee4 100644 (file)
@@ -20,6 +20,8 @@
 #include "compressor/CompressionPlugin.h"
 #include "compressor_example.h"
 
+using namespace std;
+
 class CompressorPluginExample : public CompressionPlugin {
 public:
 
index a8a66398cbcd4a43abf075feae47faad917c36b0..2bbaed760d658f046cdc6a852267e2f1af42dbdd 100644 (file)
@@ -25,6 +25,8 @@
 #include "global/global_context.h"
 #include "osd/OSDMap.h"
 
+using namespace std;
+
 class CompressorTest : public ::testing::Test,
                        public ::testing::WithParamInterface<const char*> {
 public:
index 984c3480bd63a9163d8148ff59c027f259633283..f69e22316b6a53e4127189fe978c2221888ea4b8 100644 (file)
@@ -29,6 +29,7 @@
 
 namespace fs = std::filesystem;
 
+using namespace std;
 using ceph::bufferlist;
 using std::cerr;
 using std::ostringstream;
index 07410ac81f19b3625c7e496b08fb8057dbac4bbe..6a401233882b4e2d31b1c8dabadee8c22dabfdcb 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "crush/CrushWrapper.h"
 
+using namespace std;
+
 class CrushWrapperTest : public ::testing::Test
 {
 public:
index e9421988d9d6f65eb1c2203132ce846669895e0d..2d87958b383c8d2a0d067d6ee1ae63af02d48677 100644 (file)
@@ -20,6 +20,8 @@
 #include "crush/CrushWrapper.h"
 #include "osd/osd_types.h"
 
+using namespace std;
+
 std::unique_ptr<CrushWrapper> build_indep_map(CephContext *cct, int num_rack,
                               int num_host, int num_osd)
 {
index c7e08bb41fa89ce16d1c917c3c2b85226126da07..819d41c7218d9b7fd8a9b6e30e9f6b0ddb46b09d 100644 (file)
@@ -11,6 +11,7 @@
 #include "common/ceph_context.h"
 #include "global/global_context.h"
 
+using namespace std;
 
 class CryptoEnvironment: public ::testing::Environment {
 public:
index 26048868f25fe533de3a8e4ca463941373274704..f1e7945fe8ec4e37cb9720c7b363caff2d352ab7 100644 (file)
@@ -28,7 +28,7 @@
 #include <boost/lexical_cast.hpp>
 
 
-using std::string;
+using namespace std;
 
 TEST(DaemonConfig, SimpleSet) {
   int ret;
index 88ec02f484e9a8086ecd3cffe581c3966ad72e10..1ae9849e4b253810b75c578cef8f25a5c4d701b1 100644 (file)
@@ -19,6 +19,8 @@
 #include "os/filestore/FileStore.h"
 #include <gtest/gtest.h>
 
+using namespace std;
+
 class TestFileStore {
 public:
   static void create_backend(FileStore &fs, unsigned long f_type) {
index 4a4cf4fb575125d88dba96815095d93e7f68500f..cab2d3db698d03aef55b0f78435d2499c87e0098 100644 (file)
@@ -22,6 +22,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_
 
+using namespace std;
+
 enum ceph_msgr_type {
   CEPH_MSGR_TYPE_UNDEF,
   CEPH_MSGR_TYPE_POSIX,
index 0846904b1bc01468b934a3c70a84902523a46950..fe9c793ab129f2cc14e8dcd0c9b633b118160a88 100644 (file)
@@ -32,6 +32,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_
 
+using namespace std;
+
 namespace {
 
 /// fio configuration options read from the job file
index 7a7875d41f25c5b6ecaa18bea52741e5b8cf3928..b442fb99192905ad196bf113946e1a4e9a947b60 100644 (file)
@@ -7,6 +7,8 @@
 #define MAX_CEPH_FILES 1000
 #define DIRNAME                "ino_release_cb"
 
+using namespace std;
+
 static std::atomic<bool> cb_done = false;
 
 static void cb(void *hdl, vinodeno_t vino)
index c0c629ab036435bf1f7645427e4ca2ce07248069..a8ccbffe2ffcefbb00ee86f7fb797ec9f1715d29 100644 (file)
@@ -12,6 +12,7 @@
 #include "tools/immutable_object_cache/CacheClient.h"
 #include "tools/immutable_object_cache/CacheServer.h"
 
+using namespace std;
 using namespace ceph::immutable_obj_cache;
 
 class TestMultiSession : public ::testing::Test {
index 50e35e871d482280246e4206860b37f7e9f2ee75..0da22ba2b619d9032a51bfb718229c8516eac91d 100644 (file)
@@ -8,6 +8,8 @@
 #include "common/WorkQueue.h"
 #include "journal/Settings.h"
 
+using namespace std::chrono_literals;
+
 RadosTestFixture::RadosTestFixture()
   : m_timer_lock(ceph::make_mutex("m_timer_lock")),
     m_listener(this) {
index 1601705dacf24c865ce22073faf295df8d995280..63d2d0a30d6c7348ddc251ddd404f3fccf896cc6 100644 (file)
@@ -12,6 +12,7 @@
 #include <list>
 #include <boost/scope_exit.hpp>
 
+using namespace std::chrono_literals;
 typedef std::list<journal::Entry> Entries;
 
 template <typename T>
index ac110a23e6fbe50b737a76ddf8d77a5d7080ad5a..e4ab8a141ccf3b84ed99ebacea6392d6629fc737 100644 (file)
@@ -10,6 +10,7 @@
 #include "test/journal/RadosTestFixture.h"
 #include <limits>
 
+using namespace std::chrono_literals;
 using std::shared_ptr;
 
 class TestObjectRecorder : public RadosTestFixture {
index cac42f33fb9c062f37c8080a206ef8067663adfd..7338739fa9566082b9d64cc08ecca43b1b30a16e 100644 (file)
@@ -34,6 +34,7 @@
 #include <sys/xattr.h>
 #endif
 
+using namespace std;
 
 rados_t cluster;
 
index c962c4f3ab02eb6d101e2d9ecf4db6fab1731f89..7a224a6298a308f868642b731b4bc94acede83fc 100644 (file)
@@ -48,7 +48,7 @@ class MonConfig : public ::testing::Test
     }
 
     // Helper to test basic operation on a mount
-    void use_mount(struct ceph_mount_info *mnt, string name_prefix) {
+    void use_mount(struct ceph_mount_info *mnt, std::string name_prefix) {
       char name[20];
       snprintf(name, sizeof(name), "%s.%d", name_prefix.c_str(), getpid());
       int fd = ceph_open(mnt, name, O_CREAT|O_RDWR, 0644);
index ac899f85556d7859f0e05be4e1333e145790ec62..443253fdd3278174f170ab2149f6ff417b54ddcc 100644 (file)
@@ -44,6 +44,8 @@
 #define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
 #endif
 
+using namespace std;
+
 TEST(LibCephFS, OpenEmptyComponent) {
 
   pid_t mypid = getpid();
index 84ea454e85ccfe82b3a1524fe501f2afb3f05606..9f27c61833f669e0dc8724f1bd819fde5078d031 100644 (file)
@@ -16,9 +16,8 @@
 
 #include "test_cxx.h"
 
+using namespace std;
 using namespace librados;
-using std::pair;
-using std::ostringstream;
 
 class AioTestDataPP
 {
index 9dd6b00fe0f88fe632420341d8a4fdc8d3c47bf8..12d56e85c6914240acc516f8037b86972a3a3464 100644 (file)
@@ -28,6 +28,8 @@
 #define dout_subsys ceph_subsys_rados
 #define dout_context g_ceph_context
 
+using namespace std;
+
 // test fixture for global setup/teardown
 class AsioRados : public ::testing::Test {
   static constexpr auto poolname = "ceph_test_rados_api_asio";
index 3da398c12a77d36a4974cdac2049fe898674bdfb..1d110f73b33316e61a7113ad8820648ba455aa74 100644 (file)
@@ -13,6 +13,8 @@
 #include <sstream>
 #include <string>
 
+using std::cout;
+using std::list;
 using std::map;
 using std::ostringstream;
 using std::string;
index 3307db5ac9c3f4b2e1afca84b7144c9221040aa7..930e6b9eb8ea96ad4fb833c76d398d7bb5522944 100644 (file)
@@ -15,6 +15,7 @@
 #include <string>
 #include <stdexcept>
 
+using namespace std;
 using namespace librados;
 
 typedef RadosTestNSCleanup LibRadosList;
index bffab46cbe1f60934db1f2e7d1973d5571e05256..de29f5f6efa3ac008d6887192119b5f2407393aa 100644 (file)
 #include <string>
 #include <regex>
 
+using namespace std;
 using namespace librados;
-using std::map;
-using std::ostringstream;
-using std::string;
 
 typedef RadosTest LibRadosMisc;
 
index e7ad1ec59ef0b9f6480f30c853c4c2f6589052ee..0241f1dfeb97fd5d8d28d1a34a7499e0f5e5535c 100644 (file)
 #include "test/librados/testcase_cxx.h"
 #include "test/librados/test_cxx.h"
 
+using namespace std;
 using namespace librados;
-using std::map;
-using std::ostringstream;
-using std::string;
 
 typedef RadosTestPP LibRadosMiscPP;
 typedef RadosTestECPP LibRadosMiscECPP;
index 223dc967b9af268271b997c2777faa32723c2d21..55197b6f96061d4b398eea7da1071947f1c02dc3 100644 (file)
@@ -14,6 +14,7 @@
 #include "gtest/gtest.h"
 #include "test/unit.cc"
 
+using namespace std;
 using namespace librados;
 
 TEST(LibRadosService, RegisterEarly) {
index 40869f0f8d9ff5436e08d85afa0f489312ee4a2a..1bf682af8c564a1bc009326e535e5a9d353fb4a9 100644 (file)
@@ -10,6 +10,7 @@
 #include "test/librados/testcase_cxx.h"
 #include "test/unit.cc"
 
+using namespace std;
 using namespace librados;
 
 TEST(LibRadosServicePP, RegisterEarly) {
index c17b710d17c5f94b3e81a7f2cf96a1daa65621af..647a9ff48582c64654721854183848cd433f3aa8 100644 (file)
@@ -6,6 +6,8 @@
 #include "json_spirit/json_spirit.h"
 #include "test_common.h"
 
+using namespace std;
+
 namespace {
 
 using namespace ceph;
index 06c3f77dc430fbcdb4918ef11884c7197cda391f..bd9ad2147b456059566ecbd2ea9aadbd2083292e 100644 (file)
 #include "cls/cas/cls_cas_client.h"
 #include "cls/cas/cls_cas_internal.h"
 
+using namespace std;
 using namespace librados;
-using std::map;
-using std::ostringstream;
-using std::string;
 
 typedef RadosTestPP LibRadosTierPP;
 typedef RadosTestECPP LibRadosTierECPP;
index c567147e7a20ad634ff4daf9027ea1bd8d085f96..b5ceb53eae92b973a12b3f841688f0e2a242cba8 100644 (file)
@@ -31,6 +31,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rados
 
+using namespace std;
+
 namespace librados {
 
 MockTestMemIoCtxImpl &get_mock_io_ctx(IoCtx &ioctx) {
index 73bc8d4a885364030b774dafc99c50ac9c06c003..0b106e1d122cd44118d0ce09a04f02b0e9596341 100644 (file)
@@ -13,6 +13,8 @@
 #include <functional>
 #include <errno.h>
 
+using namespace std;
+
 namespace librados {
 
 TestIoCtxImpl::TestIoCtxImpl() : m_client(NULL) {
index fea8a061191681bd20ffb49d67f6dca465c6dcf7..b206f24932cd3388dcac52821267e21808275b75 100644 (file)
@@ -26,6 +26,8 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
   librgw_t rgw = nullptr;
   string uid("testuser");
index 0a9f91b7090a9bfc4d0543dfd0f782315baa84ad..224366b4360b731811ea7e431b33df915232869d 100644 (file)
@@ -30,6 +30,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
   librgw_t rgw = nullptr;
   string userid("testuser");
index ff0bd1fbde2e71b1daa2c1544186120f401334be..8bbe350ac24553611b20cb27215db0d7eaaf007d 100644 (file)
@@ -25,6 +25,8 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
   librgw_t rgw = nullptr;
   string userid("testuser");
index bde68fb4b9e24a0a204b2d07801f8781393f16de..757fdfd8da260ff05b68c4fa12c48dc27aacb256 100644 (file)
@@ -30,6 +30,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
   librgw_t rgw = nullptr;
   string uid("testuser");
index 2475423fd468322b68a0b95eee0dcc340f255c59..3e2bce95e783bc82c991a239f233ecbfdf9f1453 100644 (file)
@@ -31,6 +31,8 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
 
   using namespace rgw;
index b2a8fd27b06ed1fb9e9e3043746c0c13fd74357d..eb48a1ee71c05970d1c965c5a2b1dcca071e4138 100644 (file)
@@ -30,6 +30,8 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
 
   using namespace rgw;
index bb4b74c9e251a92c75a38386d9d62ff942b3b00c..73902c4810bcd382908a56d7dd64e6e7e64af6bc 100644 (file)
@@ -35,6 +35,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
 
   using namespace rgw;
index 3556a8591c1b80f84165a3fec5b0427cd30de810..4828032dbd6b51d5fdba113588a960f9945d2b93 100644 (file)
@@ -19,8 +19,7 @@
 
 #include "gtest/gtest.h"
 
-using std::string;
-using std::cout;
+using namespace std;
 
 entity_addr_t addr;
 
index 90933dd7c5292302906eeabbfb95f028ed626881..279e0c28e919eabd04bc2e09a8191f9adcfa8a38 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "gtest/gtest.h"
 
+using namespace std;
+
 const char *parse_good[] = {
 
   // MgrCapMatch
index 7566651323fe12730a94625a5c64ee9d94d75b22..1d0536c178fd739bb66370997b4297b42efcb4db 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "include/stringify.h"
 
+using namespace std;
 
 namespace {
   class CheckTextTable : public TextTable {
index 1c151b1e3994f42cc8419b63d0caf69fc87a07d1..dd86224bd6848a029abd016444264b274f22e9b3 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "gtest/gtest.h"
 
+using namespace std;
+
 const char *parse_good[] = {
 
   // MonCapMatch
index fede9df8f150ba2c3369407b6bb37bdfd902eaa0..4a05876154eedc74ed94bf66614f275c1ae484ea 100644 (file)
@@ -48,6 +48,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "test-mon-msg "
 
+using namespace std;
+
 class MonClientHelper : public Dispatcher
 {
 protected:
index e6a217af309e954d2a9051de8b76819ae1969707..6cf4211b6df74deddc848a23dd134cc1e934af5d 100644 (file)
@@ -58,6 +58,7 @@
 
 #include <gtest/gtest.h>
 
+using namespace std;
 
 class EventDriverTest : public ::testing::TestWithParam<const char*> {
  public:
index f6d04f0a0eeaddd3b43b525e4c0ce228b092a7c3..d369833b846b4d11be2d08c42c8c8287253bbd9c 100644 (file)
@@ -30,6 +30,7 @@
 #include "msg/async/Event.h"
 #include "msg/async/Stack.h"
 
+using namespace std;
 
 class NoopConfigObserver : public md_config_obs_t {
   std::list<std::string> options;
index 725903251a723d28fcc6fa3f205535b76efa758a..cbcf6cab48dc8c85c533a47c7a146702845b23c3 100644 (file)
@@ -36,6 +36,8 @@
     EXPECT_EQ(val1, val2); \
   }
 
+using namespace std;
+
 namespace ceph::msgr::v2 {
 
 // MessageFrame with the first segment not fixed to ceph_msg_header2
index 3ebe320be1191274eb6cb7de849204d479efbf82..68133224c21c89231f91e00668cfeee92f40bf10 100644 (file)
@@ -59,6 +59,8 @@ typedef boost::mt11213b gen_type;
   }                                     \
 } while(0);
 
+using namespace std;
+
 class MessengerTest : public ::testing::TestWithParam<const char*> {
  public:
   DummyAuthClientServer dummy_auth;
index 4977d6a545b7d6a32f4db7f652100c4ccdcf3ba7..0d04a854e9aa94cef7b3a8d1d14f1b3a17c37675 100644 (file)
@@ -21,6 +21,8 @@ typedef boost::mt11213b gen_type;
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_
 
+using namespace std;
+
 class AllocTest : public ::testing::TestWithParam<const char*> {
 
 public:
index 76b2cd551058588cbb3aeb689634615be9a5a011..a51c5cfc6c6c131fd75240092f90daf450967029 100644 (file)
@@ -34,6 +34,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "deterministic_seq "
 
+using namespace std;
+
 DeterministicOpSequence::DeterministicOpSequence(ObjectStore *store,
                                                 std::string status)
   : TestObjectStoreState(store),
index 5a5a6ad93ce5d8ac1668456ef12a3cf164d22e3a..9c085d9a414d8dc4ae5595604e79f12eaad908ba 100644 (file)
@@ -81,7 +81,7 @@ protected:
       uint64_t len, const bufferlist& data);
   virtual void _do_set_attrs(coll_entry_t *entry,
                             hobject_t &obj,
-                            const map<string, bufferlist> &attrs);
+                            const std::map<std::string, bufferlist> &attrs);
   virtual void _do_clone(coll_entry_t *entry, hobject_t& orig_obj, hobject_t& new_obj);
   virtual void _do_clone_range(coll_entry_t *entry, hobject_t& orig_obj,
       hobject_t& new_obj, uint64_t srcoff, uint64_t srclen, uint64_t dstoff);
index a99e6f3d7d445a0816b9caf49efd0d6aef9aa5b2..c356f29b31bb448a0a8c3830dae7532657b9d217 100644 (file)
@@ -25,6 +25,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "filestore_diff "
 
+using namespace std;
+
 FileStoreDiff::FileStoreDiff(FileStore *a, FileStore *b)
     : a_store(a), b_store(b)
 {
index 880d26dfe9f23c5f352827a2159b683db6e35230..7d091cf3ee716b89095ea95e800980fad033b10a 100644 (file)
@@ -5,6 +5,8 @@
 #include <boost/scoped_ptr.hpp>
 #include "include/Context.h"
 
+using namespace std;
+
 class OnApplied : public Context {
   FileStoreTracker *tracker;
   list<pair<pair<coll_t, string>, uint64_t> > in_flight;
index 90c456250ce5d42a68c216f17a10232a7fce844f..555e48fe5c72d632a005a92344b3683ff328e69d 100644 (file)
@@ -18,7 +18,7 @@ class FileStoreTracker {
   uint64_t restart_seq;
 
   struct OutTransaction {
-    list<pair<pair<coll_t, string>, uint64_t> > *in_flight;
+    std::list<std::pair<std::pair<coll_t, std::string>, uint64_t> > *in_flight;
     ObjectStore::Transaction *t;
   };
 public:
@@ -33,75 +33,77 @@ public:
                              OutTransaction *out) = 0;
       virtual ~Op() {};
     };
-    list<Op*> ops;
+    std::list<Op*> ops;
     class Write : public Op {
     public:
       coll_t coll;
-      string oid;
+      std::string oid;
       Write(const coll_t &coll,
-           const string &oid)
+           const std::string &oid)
        : coll(coll), oid(oid) {}
       void operator()(FileStoreTracker *harness,
                      OutTransaction *out) override {
-       harness->write(make_pair(coll, oid), out);
+       harness->write(std::make_pair(coll, oid), out);
       }
     };
     class CloneRange : public Op {
     public:
       coll_t coll;
-      string from;
-      string to;
+      std::string from;
+      std::string to;
       CloneRange(const coll_t &coll,
-                const string &from,
-                const string &to)
+                const std::string &from,
+                const std::string &to)
        : coll(coll), from(from), to(to) {}
       void operator()(FileStoreTracker *harness,
                      OutTransaction *out) override {
-       harness->clone_range(make_pair(coll, from), make_pair(coll, to),
+       harness->clone_range(std::make_pair(coll, from),
+                            std::make_pair(coll, to),
                             out);
       }
     };
     class Clone : public Op {
     public:
       coll_t coll;
-      string from;
-      string to;
+      std::string from;
+      std::string to;
       Clone(const coll_t &coll,
-                const string &from,
-                const string &to)
+                const std::string &from,
+                const std::string &to)
        : coll(coll), from(from), to(to) {}
       void operator()(FileStoreTracker *harness,
                      OutTransaction *out) override {
-       harness->clone(make_pair(coll, from), make_pair(coll, to),
-                            out);
+       harness->clone(std::make_pair(coll, from),
+                      std::make_pair(coll, to),
+                      out);
       }
     };
     class Remove: public Op {
     public:
       coll_t coll;
-      string obj;
+      std::string obj;
       Remove(const coll_t &coll,
-            const string &obj)
+            const std::string &obj)
        : coll(coll), obj(obj) {}
       void operator()(FileStoreTracker *harness,
                      OutTransaction *out) override {
-       harness->remove(make_pair(coll, obj),
+       harness->remove(std::make_pair(coll, obj),
                        out);
       }
     };
   public:
-    void write(const coll_t &coll, const string &oid) {
+    void write(const coll_t &coll, const std::string &oid) {
       ops.push_back(new Write(coll, oid));
     }
-    void clone_range(const coll_t &coll, const string &from,
-                    const string &to) {
+    void clone_range(const coll_t &coll, const std::string &from,
+                    const std::string &to) {
       ops.push_back(new CloneRange(coll, from, to));
     }
-    void clone(const coll_t &coll, const string &from,
-              const string &to) {
+    void clone(const coll_t &coll, const std::string &from,
+              const std::string &to) {
       ops.push_back(new Clone(coll, from, to));
     }
-    void remove(const coll_t &coll, const string &oid) {
+    void remove(const coll_t &coll, const std::string &oid) {
       ops.push_back(new Remove(coll, oid));
     }
     friend class FileStoreTracker;
@@ -110,26 +112,26 @@ public:
   int init();
   void submit_transaction(Transaction &t);
   void verify(const coll_t &coll,
-             const string &from,
+             const std::string &from,
              bool on_start = false);
 
 private:
-  ObjectContents get_current_content(const pair<coll_t, string> &obj);
-  pair<uint64_t, uint64_t> get_valid_reads(const pair<coll_t, string> &obj);
-  ObjectContents get_content(const pair<coll_t, string> &obj, uint64_t version);
+  ObjectContents get_current_content(const std::pair<coll_t, std::string> &obj);
+  std::pair<uint64_t, uint64_t> get_valid_reads(const std::pair<coll_t, std::string> &obj);
+  ObjectContents get_content(const std::pair<coll_t, std::string> &obj, uint64_t version);
 
-  void committed(const pair<coll_t, string> &obj, uint64_t seq);
-  void applied(const pair<coll_t, string> &obj, uint64_t seq);
-  uint64_t set_content(const pair<coll_t, string> &obj, ObjectContents &content);
+  void committed(const std::pair<coll_t, std::string> &obj, uint64_t seq);
+  void applied(const std::pair<coll_t, std::string> &obj, uint64_t seq);
+  uint64_t set_content(const std::pair<coll_t, std::string> &obj, ObjectContents &content);
 
   // ObjectContents Operations
-  void write(const pair<coll_t, string> &obj, OutTransaction *out);
-  void remove(const pair<coll_t, string> &obj, OutTransaction *out);
-  void clone_range(const pair<coll_t, string> &from,
-                  const pair<coll_t, string> &to,
+  void write(const std::pair<coll_t, std::string> &obj, OutTransaction *out);
+  void remove(const std::pair<coll_t, std::string> &obj, OutTransaction *out);
+  void clone_range(const std::pair<coll_t, std::string> &from,
+                  const std::pair<coll_t, std::string> &to,
                   OutTransaction *out);
-  void clone(const pair<coll_t, string> &from,
-            const pair<coll_t, string> &to,
+  void clone(const std::pair<coll_t, std::string> &from,
+            const std::pair<coll_t, std::string> &to,
             OutTransaction *out);
   friend class OnApplied;
   friend class OnCommitted;
index fcda2d5503861b553022d2fa01c4d92a00b14cf0..f4ccef4f08c6b3d4069e46f02218ba3b41bed090 100644 (file)
@@ -30,6 +30,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "ceph_test_objectstore_state "
 
+using namespace std;
+
 void TestObjectStoreState::init(int colls, int objs)
 {
   dout(5) << "init " << colls << " colls " << objs << " objs" << dendl;
index 360f434fbae970c7fa077b4e95a0d4e5248b093d..d1e31bd8aec220a7e417629fa3278ce94c1a9240 100644 (file)
@@ -31,7 +31,7 @@ public:
     coll_t m_cid;
     ghobject_t m_meta_obj;
     ObjectStore::CollectionHandle m_ch;
-    map<int, hobject_t*> m_objects;
+    std::map<int, hobject_t*> m_objects;
     int m_next_object_id;
 
     coll_entry_t(spg_t pgid, ObjectStore::CollectionHandle& ch,
@@ -62,8 +62,8 @@ public:
 
  protected:
   boost::shared_ptr<ObjectStore> m_store;
-  map<coll_t, coll_entry_t*> m_collections;
-  vector<coll_t> m_collections_ids;
+  std::map<coll_t, coll_entry_t*> m_collections;
+  std::vector<coll_t> m_collections_ids;
   int m_next_coll_nr;
   int m_num_objs_per_coll;
   int m_num_objects;
index 3fe0d362b35b09a9d7f1f674474bb5834b35c986..f9a35bbe4be378c3b8952677edcdc8f239a1721c 100644 (file)
@@ -15,6 +15,7 @@
 #include "global/global_init.h"
 #include "os/bluestore/Allocator.h"
 
+using namespace std;
 
 void usage(const string &name) {
   cerr << "Usage: " << name << " <log_to_replay> <raw_duplicate|free_dump>"
index 0889375ed17f0deafe731e6a140a6e9ad2ae8196..267f4e7c96b5b78485b806a2b732efa296f11a14 100644 (file)
@@ -25,6 +25,8 @@
 #include "kv/KeyValueDB.h"
 #include "os/ObjectStore.h"
 
+using namespace std;
+
 void usage(const string &name) {
   std::cerr << "Usage: " << name << " [new|continue] store_path store_journal db_path"
            << std::endl;
index 7cf31fa92984537b4bb55d361eb09cafd50cb616..de053859e7ace836fdcf0f9ea810a3992afa4992 100644 (file)
@@ -32,6 +32,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "test_idempotent_sequence "
 
+using namespace std;
+
 void usage(const char *name, std::string command = "") {
   ceph_assert(name != NULL);
 
index c6efb44afdc12649be3cb7aa93ce4b527f2226f3..1de904adc23ac72b1f3bb70d94a303422daf9710 100644 (file)
@@ -27,6 +27,8 @@
 #include "include/stringify.h"
 #include <gtest/gtest.h>
 
+using namespace std;
+
 class KVTest : public ::testing::TestWithParam<const char*> {
 public:
   boost::scoped_ptr<KeyValueDB> db;
index 7bcc7b2af08dece50a1e03df88e89b6540c8d3e8..da29599cf83aa46f795dcce60472beb034c46bd1 100644 (file)
@@ -18,6 +18,8 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_filestore
 
+using namespace std;
+
 static void usage()
 {
   cout << "usage: ceph_objectstore_bench [flags]\n"
index 6fc57583a48eaf287386a69d75e9a8c5917fa18a..1874bd8d60c3186be9e3f0df91354384f830f539 100644 (file)
@@ -31,7 +31,7 @@ struct o_bench_data {
   int started_ops;
   int completed_ops;
   std::map<int,int> freq_map;
-  pair<int,int> mode;
+  std::pair<int,int> mode;
   o_bench_data()
   : avg_latency(0.0), min_latency(DBL_MAX), max_latency(0.0),
     total_latency(0.0),
@@ -49,7 +49,7 @@ typedef int (OmapBench::*test_t)(omap_generator_t omap_gen);
 
 class Writer{
 protected:
-  string oid;
+  std::string oid;
   utime_t begin_time;
   utime_t end_time;
   std::map<std::string,bufferlist> omap;
@@ -61,7 +61,7 @@ public:
   virtual void start_time();
   virtual void stop_time();
   virtual double get_time();
-  virtual string get_oid();
+  virtual std::string get_oid();
   virtual std::map<std::string,bufferlist> & get_omap();
 };
 
@@ -94,9 +94,9 @@ protected:
   int busythreads_count;
   librados::callback_t comp;
 
-  string pool_name;
-  string rados_id;
-  string prefix;
+  std::string pool_name;
+  std::string rados_id;
+  std::string prefix;
   int threads;
   int objects;
   int entries_per_omap;
@@ -137,7 +137,7 @@ public:
   /**
    * Generates a random string len characters long
    */
-  static string random_string(int len);
+  static std::string random_string(int len);
 
   /*
    * runs the test specified by test using the omap generator specified by
index affff369442ae320a47443ece2a1b6e57c8353ce..1c13fb4c95c0173bbc3739d7b8a06af012f4c2e7 100644 (file)
@@ -19,6 +19,8 @@
 #include "osd/ECBackend.h"
 #include "gtest/gtest.h"
 
+using namespace std;
+
 TEST(ECUtil, stripe_info_t)
 {
   const uint64_t swidth = 4096;
index a279287fde646ff1a85a1839eb1631bd772687c5..2c680558ff12fe4fdabb1dff8621f3bf62ebe634 100644 (file)
@@ -23,8 +23,8 @@ public:
 
   class TypeStatus {
   public:
-    map<TestOp*,uint64_t> inflight;
-    multiset<uint64_t> latencies;
+    std::map<TestOp*,uint64_t> inflight;
+    std::multiset<uint64_t> latencies;
     void begin(TestOp *in)
     {
       ceph_assert(!inflight.count(in));
@@ -39,9 +39,9 @@ public:
       inflight.erase(in);
     }
 
-    void export_latencies(map<double,uint64_t> &in) const;
+    void export_latencies(std::map<double,uint64_t> &in) const;
   };
-  map<string,TypeStatus> stats;
+  std::map<std::string,TypeStatus> stats;
 
   void begin(TestOp *in);
   void end(TestOp *in);
index 3c45d1212e459a6fcb111230dd15f7746eb70d79..3aab689a6d281d357223261db3a5e053da28e265 100644 (file)
@@ -27,6 +27,7 @@
 #include "include/coredumpctl.h"
 #include "../objectstore/store_test_fixture.h"
 
+using namespace std;
 
 struct PGLogTestBase {
   static hobject_t mk_obj(unsigned id) {
index 41b5aa6d348f041cfabc572bf2058ad13a2214fd..5623d47f65eac6bd5ee17f10a4674dba93b099b6 100644 (file)
 #include <sstream>
 #include <string>
 
+using namespace std;
 using namespace librados;
-using std::map;
-using std::ostringstream;
-using std::string;
 
 int get_primary_osd(Rados& rados, const string& pool_name,
                    const string& oid, int *pprimary)
index f1b80faaea4642b864e8c28489e7397f9fc44bcd..f8e29aa376672c8791acfc762034fb495e552127 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "gtest/gtest.h"
 
+using namespace std;
+
 const char *parse_good[] = {
   "allow *",
   "allow r",
index 04b638a9a90612b0657964fdb70eef2d971aecd1..9c789ca3274515991ac0770bf6a08e7beb9e3598 100644 (file)
@@ -17,6 +17,8 @@
 #include "osd/ExtentCache.h"
 #include <iostream>
 
+using namespace std;
+
 extent_map imap_from_vector(vector<pair<uint64_t, uint64_t> > &&in)
 {
   extent_map out;
index 63b6197bf2dc170b129c98fdabaaa2b1c9a2f3b8..6aa26920d460189fc95842b00faef259c3420175 100644 (file)
@@ -15,6 +15,8 @@
 #include <gtest/gtest.h>
 #include "osd/PGTransaction.h"
 
+using namespace std;
+
 TEST(pgtransaction, simple)
 {
   hobject_t h;
index c452176bcfc31df01f57f85cda559ede1b1aed4a..d7b7862f5135b92971c648ea13442556e571dcc6 100644 (file)
@@ -25,6 +25,8 @@
 #include "osd/ReplicatedBackend.h"
 #include <sstream>
 
+using namespace std;
+
 TEST(hobject, prefixes0)
 {
   uint32_t mask = 0xE947FA20;
index 371117ef6f2c22112c4c1a2656d3399137ade7fb..f69905017f1b65bd998052af870f67947db4b06f 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <atomic>
 
+using namespace std;
+
 // XXX: Only tests default namespace
 struct op_data {
   op_data(const std::string &oid, uint64_t offset, uint64_t len, bool read)
index cacf218912e7444201a2697a0e05a779c9a4bfac..a4dfe48d1e7b7a3418a6cc97fea7fafa4177034b 100644 (file)
@@ -46,6 +46,8 @@
 
 #include "common/common_init.h"
 
+using namespace std;
+
 int main(int argc, char **argv) {
   map<string,string> defaults = {
     { "admin_socket", get_rand_socket_path() }
@@ -252,4 +254,4 @@ TEST(PerfCounters, read_avg) {
   std::thread t2(counters_readavg_test, fake_pf);
   t2.join();
   t1.join();
-}
\ No newline at end of file
+}
index ecd7dc7924639fc67c192ae2d0d4cf020c7b7fa0..460411fc0d5281ea776bd077c41da20ffb586296 100644 (file)
@@ -58,6 +58,7 @@
 
 #include <atomic>
 
+using namespace std;
 using namespace ceph;
 
 /**
index 373d004a71fce715f575cce1c440427002225367..4a473ed34669ff9262aaeef41a6412cd74d2cbc2 100644 (file)
@@ -67,6 +67,7 @@ struct rbd_bencher {
   }
 
   void wait_for(int max) {
+    using namespace std::chrono_literals;
     std::unique_lock l{lock};
     while (in_flight > max) {
       cond.wait_for(l, 200ms);
index 02678c5221275a5c5925d840c6625c7ea2ed512f..e4c4375c4de337d3ea497037722616d25c9cbc47 100644 (file)
@@ -30,6 +30,9 @@
 
 #include "gtest/gtest.h"
 
+using namespace std::literals;
+using namespace std::string_literals;
+
 namespace R = librados;
 namespace cb = ceph::buffer;
 namespace fifo = rados::cls::fifo;
index c67debb9f59e02552ef84af9443cbfd77d87c5bc..6c9a1b9e3c0d0f1cdf7371297cdb0a237c23bea1 100644 (file)
@@ -189,7 +189,7 @@ TEST_F(LogBacking, TestFIFOEmpty)
 }
 
 TEST(CursorGen, RoundTrip) {
-  const auto pcurs = "fded"sv;
+  const std::string_view pcurs = "fded";
   {
     auto gc = gencursor(0, pcurs);
     ASSERT_EQ(pcurs, gc);
index 29ab3e4ac38a6d14440e05e804bc0c903f940208..40a48ee320a807f44c659cc5e713f600a776e8a1 100644 (file)
@@ -101,7 +101,7 @@ struct old_rgw_bucket {
 
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<old_rgw_bucket*>& o);
+  static void generate_test_instances(std::list<old_rgw_bucket*>& o);
 
   bool operator<(const old_rgw_bucket& b) const {
     return name.compare(b.name) < 0;
@@ -167,7 +167,7 @@ public:
   }
 
   int clear_instance() {
-    return set_instance(string());
+    return set_instance(std::string());
   }
 
   void set_loc(const std::string& k) {
@@ -217,7 +217,7 @@ public:
       object = "_";
       object.append(ns);
       if (need_to_encode_instance()) {
-        object.append(string(":") + instance);
+        object.append(std::string(":") + instance);
       }
       object.append("_");
       object.append(o);
@@ -269,7 +269,7 @@ public:
     key->instance = instance;
   }
 
-  static void parse_ns_field(string& ns, std::string& instance) {
+  static void parse_ns_field(std::string& ns, std::string& instance) {
     int pos = ns.find(':');
     if (pos >= 0) {
       instance = ns.substr(pos + 1);
@@ -290,7 +290,7 @@ public:
    * and cuts down the name to the unmangled version. If it is not
    * part of the given namespace, it returns false.
    */
-  static bool translate_raw_obj_to_obj_in_ns(string& obj, std::string& instance, std::string& ns) {
+  static bool translate_raw_obj_to_obj_in_ns(std::string& obj, std::string& instance, std::string& ns) {
     if (obj[0] != '_') {
       if (ns.empty()) {
         return true;
@@ -342,7 +342,7 @@ public:
    * It returns true after successfully doing so, or
    * false if it fails.
    */
-  static bool strip_namespace_from_object(string& obj, std::string& ns, std::string& instance) {
+  static bool strip_namespace_from_object(std::string& obj, std::string& ns, std::string& instance) {
     ns.clear();
     instance.clear();
     if (obj[0] != '_') {
@@ -448,7 +448,7 @@ public:
 };
 WRITE_CLASS_ENCODER(old_rgw_obj)
 
-static inline void prepend_old_bucket_marker(const old_rgw_bucket& bucket, const string& orig_oid, string& oid)
+static inline void prepend_old_bucket_marker(const old_rgw_bucket& bucket, const std::string& orig_oid, std::string& oid)
 {
   if (bucket.marker.empty() || orig_oid.empty()) {
     oid = orig_oid;
index c8d492c7d3c22bd675f1e584cc79120aa84a76a4..442931947b1ab6c48d6c27e59d706351d13f79d1 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <sstream>
 
+using namespace std;
+
 // input, parsed+printed addr output, leftover
 // if the parse fails, output + leftover should both be blank.
 const char *addr_checks[][3] = {
index 07f6752d777bbf96e91be7346bb11a79438f692d..a8b12dadd41128b9192f32cddc260ef955e7497d 100644 (file)
@@ -27,14 +27,14 @@ void sigterm_handler(int signum)
   for (auto& shard : shards) {
     total += shard.bytes;
   }
-  cout << total << std::endl;
+  std::cout << total << std::endl;
   exit(0);
 }
 
 int main(int argc, const char **argv)
 {
   int ret = 0;
-  vector<const char*> args;
+  std::vector<const char*> args;
   argv_to_vec(argc, argv, args);
   auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
                         CODE_ENVIRONMENT_UTILITY,
index 0924ee4eda2c8fa65462bc25fc2405db2299166d..0aae8dbbcc418b3b151c43b8433226feb2c5822d 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "include/denc.h"
 
+using namespace std;
+
 // test helpers
 
 template<typename T>
index bfd2c537c2acc791fc807b13913757d0af2f334a..5a13647e9f1fd8d71c2ede2cc4f3a0b437edec27 100644 (file)
@@ -10,6 +10,7 @@
 #include "gtest/gtest.h"
 #include "include/ceph_features.h"
 
+using namespace std;
 
 TEST(features, release_features)
 {
index b34c1d028bb6c9496547b6392f33f3b75d050b00..356b1932328b4621cb8ad6aa26d8560e6e2e97c1 100644 (file)
@@ -14,6 +14,8 @@
 #include "common/safe_io.h"
 #include "os/filestore/JournalingObjectStore.h"
 
+using namespace std;
+
 Finisher *finisher;
 ceph::condition_variable sync_cond;
 char path[200];
index c7f42dad34cadacd7a57e688211f81859a3f322a..bc8dbef70d7e1a9406a53dd8f644a0d8a4cffdce 100644 (file)
@@ -19,6 +19,8 @@
 #include <net/if.h>
 #endif
 
+using namespace std;
+
 static void ipv4(struct sockaddr_in *addr, const char *s) {
   int err;
 
index 6ac3bc31e6a7e4d0900d96ca6444c31175630004..4b8c144be23a60bda939c3b717af80cb5d9cd5f2 100644 (file)
@@ -23,6 +23,8 @@
 #include "include/btree_map.h"
 #include "include/mempool.h"
 
+using namespace std;
+
 void check_usage(mempool::pool_index_t ix)
 {
   mempool::pool_t *pool = &mempool::get_pool(ix);
index b453895ccc136f62c3fde5ec8c8a1223b7bf3941..98841e7cc09496e78de7d02fc090bdfecd15a179 100644 (file)
@@ -41,7 +41,7 @@ static void usage(void)
 int main(int argc, const char **argv)
 {
   int ret = 0;
-  vector<const char*> args;
+  std::vector<const char*> args;
   argv_to_vec(argc, argv, args);
   auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
                         CODE_ENVIRONMENT_UTILITY,
index 7c36149ade596451365bac4ac18492fede351765..0369c933909ad8fd2f9b81dfe2bf5a4f255fdaa7 100644 (file)
@@ -28,6 +28,8 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 namespace {
 
   struct {
index b9174781933c229673b0f4a37ad9ded05b3c8a6c..321e26fcc9c17e850eef877bcd5419bd652b0336 100644 (file)
@@ -49,6 +49,8 @@ namespace {
   bool verbose {false};
 }
 
+using namespace std;
+
 TEST(TOKEN, INIT) {
   formatter = new JSONFormatter(true /* pretty */);
   ASSERT_NE(formatter, nullptr);
index c294d646820464bbe7a68810403f20d6f6a38442..ee70304ebc88c590d33ed2b1be21a1a442118d24 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "osdc/Striper.h"
 
+using namespace std;
+
 TEST(Striper, Stripe1)
 {
   file_layout_t l;
index b52c6109cbf97a7f107c44f3ca16a75185a9caf8..98e407927e454abde67c767e91c06275047e5772 100644 (file)
@@ -24,6 +24,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout
 
+using namespace std;
+
 struct Foo : public Thread {
   void *entry() override {
     dout(0) << "foo started" << dendl;
index dd26093c08994bb10f2b1cb6b208c5fbc71a72c7..b1cee0e805ccb3870dcd53c6a9300d9729185825 100644 (file)
@@ -3,6 +3,8 @@
 #include "include/stringify.h"
 #include "common/ceph_context.h"
 
+using namespace std;
+
 TEST(utime_t, localtime)
 {
   utime_t t(1556122013, 839991182);
index 5995015addc7bf3507b615b091fa9629715e7ed5..d3354d633ca0f1a5557e8d9f5161a121af273651 100644 (file)
@@ -3,6 +3,8 @@
 #include "common/WorkQueue.h"
 #include "common/ceph_argparse.h"
 
+using namespace std;
+
 TEST(WorkQueue, StartStop)
 {
   ThreadPool tp(g_ceph_context, "foo", "tp_foo", 10, "");
index 4e8a7e2c86e6bd32d1c1ef1e108957e894f1f3b8..2efb9b219b9e1a639e2b64acac3cac005fc2f6f5 100644 (file)
@@ -10,6 +10,8 @@
 
 #define dout_context g_ceph_context
 
+using namespace std;
+
 int main(int argc, char *argv[])
 {
   char aes_key[AES_KEY_LEN];
index 16e52d6db1c42cf68f4582c5b56c4eddf49ea1e4..3ad794f5edab01608435c0bf6c8fe9ab1a6d0c6d 100644 (file)
@@ -8,6 +8,8 @@
 
 #define AES_KEY_LEN    16
 
+using namespace std;
+
 int main(int argc, const char **argv)
 {
   vector<const char*> args;