]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/objectstore: build without "using namespace std"
authorKefu Chai <kchai@redhat.com>
Wed, 11 Aug 2021 03:50:47 +0000 (11:50 +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>
src/test/objectstore/Allocator_test.cc
src/test/objectstore/chain_xattr.cc
src/test/objectstore/store_test.cc
src/test/objectstore/store_test_fixture.cc
src/test/objectstore/test_bdev.cc
src/test/objectstore/test_bluefs.cc
src/test/objectstore/test_bluestore_types.cc
src/test/objectstore/test_memstore_clone.cc
src/test/objectstore/test_transaction.cc
src/test/os/TestLFNIndex.cc

index 29bbd73946f5382e467e409943ded33d55cceee2..40fbed12bd3a00a9a9c43818faa693af850b9c50 100644 (file)
@@ -14,6 +14,8 @@
 #include "include/Context.h"
 #include "os/bluestore/Allocator.h"
 
+using namespace std;
+
 typedef boost::mt11213b gen_type;
 
 class AllocTest : public ::testing::TestWithParam<const char*> {
index 27c6bbb2f6d5322c2233e3b2eb856913e0d80707..c7bf09e7e92c87776b393e3421b65025d781f216 100644 (file)
@@ -32,6 +32,8 @@
 #define LARGE_BLOCK_LEN CHAIN_XATTR_MAX_BLOCK_LEN + 1024
 #define FILENAME "chain_xattr"
 
+using namespace std;
+
 TEST(chain_xattr, get_and_set) {
   const char* file = FILENAME;
   ::unlink(file);
index 883ad0121be9c4f30aa8c294c151a7be2b15a7b9..16133241fd7af39fe6772f41b093fa0996fa0d39 100644 (file)
@@ -43,6 +43,7 @@
 #include "include/unordered_map.h"
 #include "store_test_fixture.h"
 
+using namespace std;
 using namespace std::placeholders;
 
 typedef boost::mt11213b gen_type;
index 2b26207d4e51b5741a0bcf3c5b77db739f58dd8f..130c2c78bb9a9df922f106ae6ca54d1c55333d53 100644 (file)
@@ -13,6 +13,8 @@
 #endif
 #include "store_test_fixture.h"
 
+using namespace std;
+
 static void rm_r(const string& path)
 {
   string cmd = string("rm -r ") + path;
index b24368f0a05632646e74e275874af05a671d713c..e5e591a38c4d31ac22b249100616731fc09aa1c4 100755 (executable)
@@ -14,6 +14,8 @@
 
 #include "blk/BlockDevice.h"
 
+using namespace std;
+
 class TempBdev {
 public:
   TempBdev(uint64_t size)
index 551d143223d102e6b1980fe2d2c030ec43640efc..1de92744868fa91d4a8512ae109bec37fa1f1e81 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "os/bluestore/BlueFS.h"
 
+using namespace std;
+
 std::unique_ptr<char[]> gen_buffer(uint64_t size)
 {
     std::unique_ptr<char[]> buffer = std::make_unique<char[]>(size);
index a830915952affd102582c601fa87c604b7ba56b1..e3b14f9c27288bd1d9e7e44a9a6066642241ddfa 100644 (file)
@@ -17,6 +17,8 @@
 #define _STR(x) #x
 #define STRINGIFY(x) _STR(x)
 
+using namespace std;
+
 TEST(bluestore, sizeof) {
 #define P(t) cout << STRINGIFY(t) << "\t" << sizeof(t) << std::endl
   P(BlueStore::Onode);
index 85d4132949e8a3c90cc1843c8a2b8bbb73108194..2a0ea093f86baf86268153a1d5fdb570169de33c 100644 (file)
@@ -22,6 +22,8 @@
 
 #define dout_context g_ceph_context
 
+using namespace std;
+
 namespace {
 
 const coll_t cid;
index 6d7c9fe0f984b798d3d21035650152edc7b2ccf7..381b9df7d64201bf8306a269969480bdbbb1684c 100644 (file)
@@ -18,6 +18,8 @@
 #include "include/utime.h"
 #include <boost/tuple/tuple.hpp>
 
+using namespace std;
+
 TEST(Transaction, MoveConstruct)
 {
   auto a = ObjectStore::Transaction{};
index d74de739d1e5c0703be3e41e460bf18111791323..053af6db22abe255fa0a830c83238e473bfd1f35 100644 (file)
@@ -27,6 +27,8 @@
 #include "global/global_init.h"
 #include <gtest/gtest.h>
 
+using namespace std;
+
 class TestWrapLFNIndex : public LFNIndex {
 public:
   TestWrapLFNIndex(CephContext* cct,