Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/disjointCoarseMallocPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,10 @@ TEST_P(CoarseWithMemoryStrategyTest, disjointCoarseMMapPool_random) {

const size_t init_buffer_size = 200 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

const unsigned char alloc_check_val = 11;

Expand Down
35 changes: 15 additions & 20 deletions test/provider_coarse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ TEST_F(test, coarseProvider_name_no_upstream) {

const size_t init_buffer_size = 20 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

coarse_memory_provider_params_t coarse_memory_provider_params;
// make sure there are no undefined members - prevent a UB
Expand Down Expand Up @@ -159,11 +158,10 @@ TEST_P(CoarseWithMemoryStrategyTest, coarseProvider_wrong_params_1) {

const size_t init_buffer_size = 20 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

coarse_memory_provider_params_t coarse_memory_provider_params;
// make sure there are no undefined members - prevent a UB
Expand Down Expand Up @@ -223,11 +221,10 @@ TEST_P(CoarseWithMemoryStrategyTest, coarseProvider_wrong_params_3) {

const size_t init_buffer_size = 20 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

coarse_memory_provider_params_t coarse_memory_provider_params;
// make sure there are no undefined members - prevent a UB
Expand Down Expand Up @@ -284,11 +281,10 @@ TEST_P(CoarseWithMemoryStrategyTest, coarseProvider_wrong_params_5) {

const size_t init_buffer_size = 20 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

coarse_memory_provider_params_t coarse_memory_provider_params;
// make sure there are no undefined members - prevent a UB
Expand Down Expand Up @@ -521,11 +517,10 @@ TEST_P(CoarseWithMemoryStrategyTest, coarseProvider_purge_no_upstream) {

const size_t init_buffer_size = 20 * MB;

// Preallocate some memory
std::unique_ptr<char[]> buffer(new char[init_buffer_size]);
void *buf = buffer.get();
// preallocate some memory and initialize the vector with zeros
std::vector<char> buffer(init_buffer_size, 0);
void *buf = (void *)buffer.data();
ASSERT_NE(buf, nullptr);
memset(buf, 0, init_buffer_size);

coarse_memory_provider_params_t coarse_memory_provider_params;
// make sure there are no undefined members - prevent a UB
Expand Down
Loading