Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
mutouyun committed Dec 23, 2023
1 parent 3be10b6 commit c10d84a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/pmr/test_pmr_block_pool.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include <type_traits>
#include <algorithm>

#include "gtest/gtest.h"

Expand All @@ -16,11 +17,11 @@ TEST(block_pool, central_cache_allocator) {

TEST(block_pool, block) {
pmr::block<1> b1;
EXPECT_EQ(sizeof(b1), sizeof(void*));
pmr::block<sizeof(void*)> b2;
EXPECT_EQ(sizeof(b2), sizeof(void*));
pmr::block<sizeof(void*) + 1> b3;
EXPECT_EQ(sizeof(b3), sizeof(void*) * 2);
EXPECT_EQ(sizeof(b1), (std::max)(alignof(std::max_align_t), sizeof(void *)));
pmr::block<sizeof(void *)> b2;
EXPECT_EQ(sizeof(b2), (std::max)(alignof(std::max_align_t), sizeof(void *)));
pmr::block<sizeof(void *) + 1> b3;
EXPECT_EQ(sizeof(b3), (std::max)(alignof(std::max_align_t), sizeof(void *) * 2));
}

TEST(block_pool, central_cache_pool_ctor) {
Expand Down

0 comments on commit c10d84a

Please sign in to comment.