#include "global/global_context.h"
#include "common/dout.h"
+using namespace std;
using namespace ceph::logging;
TEST(Log, Simple)
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) {}
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 {
}
};
- 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);
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);
}
~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;
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;
}
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));
}
#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()
*/
#define MAX_TEST_CONTEXTS 5
+using namespace std;
+
class TestContext;
namespace
#include <string>
#include <sys/un.h>
+using namespace std;
+
class AdminSocketTest
{
public:
#include "admin_socket_output.h"
+using namespace std;
+
void AdminSocketOutput::add_target(const std::string& target) {
if (target == "all") {
add_target("osd");
#include "gtest/gtest.h"
+using namespace std;
+
TEST(RoundTrip, SimpleRoundTrip) {
static const int OUT_LEN = 4096;
const char * const original = "abracadabra";
#define dout_context g_ceph_context
+using namespace std;
+
struct T : public Thread {
int num;
set<int> myset;
#define MAX_TEST 1000000
#define FILENAME "bufferlist"
+using namespace std;
+
static char cmd[128];
struct instrumented_bptr : public ceph::buffer::ptr {
#include <vector>
#include "include/stringify.h"
+using namespace std;
+
/* Holds a std::vector with C-strings.
* Will free() them properly in the destructor.
*
#include "gtest/gtest.h"
#include <vector>
+using namespace std;
+
TEST(CephCompatSet, AllSet) {
CompatSet::FeatureSet compat;
CompatSet::FeatureSet ro;
{
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));
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);
#include <chrono>
#include <atomic>
+using namespace std;
+
class TestCls2PCQueue : public ::testing::Test {
protected:
librados::Rados rados;
#include <string>
#include <vector>
+using namespace std;
/// creates a temporary pool and initializes an IoCtx for each test
class cls_cas : public ::testing::Test {
#include "neorados/cls/fifo.h"
+using namespace std;
+
namespace ba = boost::asio;
namespace bs = boost::system;
namespace bpo = boost::program_options;
#include "gtest/gtest.h"
+using namespace std;
+
namespace R = neorados;
namespace ba = boost::asio;
namespace bs = boost::system;
#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,
#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;
#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
*/
#include <chrono>
#include <atomic>
+using namespace std;
+
class TestClsQueue : public ::testing::Test {
protected:
librados::Rados rados;
#include <string>
#include <vector>
+using namespace std;
+
static librados::ObjectWriteOperation *new_op() {
return new librados::ObjectWriteOperation();
}
#include <map>
#include <set>
+using namespace std;
using namespace librados;
// creates a temporary pool and initializes an IoCtx shared by all tests
#include <map>
#include <set>
+using namespace std;
using namespace librados;
librados::Rados rados;
#include <string>
#include <vector>
+using namespace std;
+
static librados::ObjectWriteOperation *new_op() {
return new librados::ObjectWriteOperation();
}
#include "compressor/CompressionPlugin.h"
#include "compressor_example.h"
+using namespace std;
+
class CompressorPluginExample : public CompressionPlugin {
public:
#include "global/global_context.h"
#include "osd/OSDMap.h"
+using namespace std;
+
class CompressorTest : public ::testing::Test,
public ::testing::WithParamInterface<const char*> {
public:
namespace fs = std::filesystem;
+using namespace std;
using ceph::bufferlist;
using std::cerr;
using std::ostringstream;
#include "crush/CrushWrapper.h"
+using namespace std;
+
class CrushWrapperTest : public ::testing::Test
{
public:
#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)
{
#include "common/ceph_context.h"
#include "global/global_context.h"
+using namespace std;
class CryptoEnvironment: public ::testing::Environment {
public:
#include <boost/lexical_cast.hpp>
-using std::string;
+using namespace std;
TEST(DaemonConfig, SimpleSet) {
int ret;
#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) {
#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,
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_
+using namespace std;
+
namespace {
/// fio configuration options read from the job file
#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)
#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 {
#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) {
#include <list>
#include <boost/scope_exit.hpp>
+using namespace std::chrono_literals;
typedef std::list<journal::Entry> Entries;
template <typename T>
#include "test/journal/RadosTestFixture.h"
#include <limits>
+using namespace std::chrono_literals;
using std::shared_ptr;
class TestObjectRecorder : public RadosTestFixture {
#include <sys/xattr.h>
#endif
+using namespace std;
rados_t cluster;
}
// 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);
#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();
#include "test_cxx.h"
+using namespace std;
using namespace librados;
-using std::pair;
-using std::ostringstream;
class AioTestDataPP
{
#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";
#include <sstream>
#include <string>
+using std::cout;
+using std::list;
using std::map;
using std::ostringstream;
using std::string;
#include <string>
#include <stdexcept>
+using namespace std;
using namespace librados;
typedef RadosTestNSCleanup LibRadosList;
#include <string>
#include <regex>
+using namespace std;
using namespace librados;
-using std::map;
-using std::ostringstream;
-using std::string;
typedef RadosTest LibRadosMisc;
#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;
#include "gtest/gtest.h"
#include "test/unit.cc"
+using namespace std;
using namespace librados;
TEST(LibRadosService, RegisterEarly) {
#include "test/librados/testcase_cxx.h"
#include "test/unit.cc"
+using namespace std;
using namespace librados;
TEST(LibRadosServicePP, RegisterEarly) {
#include "json_spirit/json_spirit.h"
#include "test_common.h"
+using namespace std;
+
namespace {
using namespace ceph;
#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;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rados
+using namespace std;
+
namespace librados {
MockTestMemIoCtxImpl &get_mock_io_ctx(IoCtx &ioctx) {
#include <functional>
#include <errno.h>
+using namespace std;
+
namespace librados {
TestIoCtxImpl::TestIoCtxImpl() : m_client(NULL) {
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
librgw_t rgw = nullptr;
string uid("testuser");
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
librgw_t rgw = nullptr;
string userid("testuser");
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
librgw_t rgw = nullptr;
string userid("testuser");
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
librgw_t rgw = nullptr;
string uid("testuser");
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
using namespace rgw;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
using namespace rgw;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
using namespace rgw;
#include "gtest/gtest.h"
-using std::string;
-using std::cout;
+using namespace std;
entity_addr_t addr;
#include "gtest/gtest.h"
+using namespace std;
+
const char *parse_good[] = {
// MgrCapMatch
#include "include/stringify.h"
+using namespace std;
namespace {
class CheckTextTable : public TextTable {
#include "gtest/gtest.h"
+using namespace std;
+
const char *parse_good[] = {
// MonCapMatch
#undef dout_prefix
#define dout_prefix *_dout << "test-mon-msg "
+using namespace std;
+
class MonClientHelper : public Dispatcher
{
protected:
#include <gtest/gtest.h>
+using namespace std;
class EventDriverTest : public ::testing::TestWithParam<const char*> {
public:
#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;
EXPECT_EQ(val1, val2); \
}
+using namespace std;
+
namespace ceph::msgr::v2 {
// MessageFrame with the first segment not fixed to ceph_msg_header2
} \
} while(0);
+using namespace std;
+
class MessengerTest : public ::testing::TestWithParam<const char*> {
public:
DummyAuthClientServer dummy_auth;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_
+using namespace std;
+
class AllocTest : public ::testing::TestWithParam<const char*> {
public:
#undef dout_prefix
#define dout_prefix *_dout << "deterministic_seq "
+using namespace std;
+
DeterministicOpSequence::DeterministicOpSequence(ObjectStore *store,
std::string status)
: TestObjectStoreState(store),
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);
#undef dout_prefix
#define dout_prefix *_dout << "filestore_diff "
+using namespace std;
+
FileStoreDiff::FileStoreDiff(FileStore *a, FileStore *b)
: a_store(a), b_store(b)
{
#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;
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:
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;
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;
#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;
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,
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;
#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>"
#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;
#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);
#include "include/stringify.h"
#include <gtest/gtest.h>
+using namespace std;
+
class KVTest : public ::testing::TestWithParam<const char*> {
public:
boost::scoped_ptr<KeyValueDB> db;
#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"
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),
class Writer{
protected:
- string oid;
+ std::string oid;
utime_t begin_time;
utime_t end_time;
std::map<std::string,bufferlist> omap;
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();
};
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;
/**
* 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
#include "osd/ECBackend.h"
#include "gtest/gtest.h"
+using namespace std;
+
TEST(ECUtil, stripe_info_t)
{
const uint64_t swidth = 4096;
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));
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);
#include "include/coredumpctl.h"
#include "../objectstore/store_test_fixture.h"
+using namespace std;
struct PGLogTestBase {
static hobject_t mk_obj(unsigned id) {
#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)
#include "gtest/gtest.h"
+using namespace std;
+
const char *parse_good[] = {
"allow *",
"allow r",
#include "osd/ExtentCache.h"
#include <iostream>
+using namespace std;
+
extent_map imap_from_vector(vector<pair<uint64_t, uint64_t> > &&in)
{
extent_map out;
#include <gtest/gtest.h>
#include "osd/PGTransaction.h"
+using namespace std;
+
TEST(pgtransaction, simple)
{
hobject_t h;
#include "osd/ReplicatedBackend.h"
#include <sstream>
+using namespace std;
+
TEST(hobject, prefixes0)
{
uint32_t mask = 0xE947FA20;
#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)
#include "common/common_init.h"
+using namespace std;
+
int main(int argc, char **argv) {
map<string,string> defaults = {
{ "admin_socket", get_rand_socket_path() }
std::thread t2(counters_readavg_test, fake_pf);
t2.join();
t1.join();
-}
\ No newline at end of file
+}
#include <atomic>
+using namespace std;
using namespace ceph;
/**
}
void wait_for(int max) {
+ using namespace std::chrono_literals;
std::unique_lock l{lock};
while (in_flight > max) {
cond.wait_for(l, 200ms);
#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;
}
TEST(CursorGen, RoundTrip) {
- const auto pcurs = "fded"sv;
+ const std::string_view pcurs = "fded";
{
auto gc = gencursor(0, pcurs);
ASSERT_EQ(pcurs, gc);
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;
}
int clear_instance() {
- return set_instance(string());
+ return set_instance(std::string());
}
void set_loc(const std::string& k) {
object = "_";
object.append(ns);
if (need_to_encode_instance()) {
- object.append(string(":") + instance);
+ object.append(std::string(":") + instance);
}
object.append("_");
object.append(o);
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);
* 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;
* 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] != '_') {
};
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;
#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] = {
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,
#include "include/denc.h"
+using namespace std;
+
// test helpers
template<typename T>
#include "gtest/gtest.h"
#include "include/ceph_features.h"
+using namespace std;
TEST(features, release_features)
{
#include "common/safe_io.h"
#include "os/filestore/JournalingObjectStore.h"
+using namespace std;
+
Finisher *finisher;
ceph::condition_variable sync_cond;
char path[200];
#include <net/if.h>
#endif
+using namespace std;
+
static void ipv4(struct sockaddr_in *addr, const char *s) {
int err;
#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);
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,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
struct {
bool verbose {false};
}
+using namespace std;
+
TEST(TOKEN, INIT) {
formatter = new JSONFormatter(true /* pretty */);
ASSERT_NE(formatter, nullptr);
#include "osdc/Striper.h"
+using namespace std;
+
TEST(Striper, Stripe1)
{
file_layout_t l;
#undef dout_prefix
#define dout_prefix *_dout
+using namespace std;
+
struct Foo : public Thread {
void *entry() override {
dout(0) << "foo started" << dendl;
#include "include/stringify.h"
#include "common/ceph_context.h"
+using namespace std;
+
TEST(utime_t, localtime)
{
utime_t t(1556122013, 839991182);
#include "common/WorkQueue.h"
#include "common/ceph_argparse.h"
+using namespace std;
+
TEST(WorkQueue, StartStop)
{
ThreadPool tp(g_ceph_context, "foo", "tp_foo", 10, "");
#define dout_context g_ceph_context
+using namespace std;
+
int main(int argc, char *argv[])
{
char aes_key[AES_KEY_LEN];
#define AES_KEY_LEN 16
+using namespace std;
+
int main(int argc, const char **argv)
{
vector<const char*> args;