#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_
+using namespace std;
+
class AllocTest : public ::testing::TestWithParam<const char*> {
public:
AllocTest(): alloc(0) { }
void init_alloc(int64_t size, uint64_t min_alloc_size) {
std::cout << "Creating alloc type " << string(GetParam()) << " \n";
- alloc.reset(Allocator::create(g_ceph_context, string(GetParam()), size,
+ alloc.reset(Allocator::create(g_ceph_context, GetParam(), size,
min_alloc_size));
}
uint64_t alloc_size = 4 * 1024;
uint64_t capacity = 512ll * 1024 * 1024 * 1024;
- Allocator* alloc = Allocator::create(g_ceph_context, string(GetParam()),
+ Allocator* alloc = Allocator::create(g_ceph_context, GetParam(),
capacity, alloc_size);
ASSERT_NE(alloc, nullptr);
alloc->init_add_free(0, capacity);
PExtentVector tmp;
alloc->allocate(alloc_size, alloc_size, 0, 0, &tmp);
all_allocs[rand()] = tmp;
+ tmp.clear();
alloc->allocate(alloc_size, alloc_size, 0, 0, &tmp);
all_allocs[rand()] = tmp;
+ tmp.clear();
auto it = all_allocs.upper_bound(rand());
if (it != all_allocs.end()) {
INSTANTIATE_TEST_SUITE_P(
Allocator,
AllocTest,
- ::testing::Values("stupid", "bitmap", "avl", "hybrid"));
+ ::testing::Values("stupid", "bitmap", "avl", "btree", "hybrid"));