@@ -22,24 +22,15 @@ namespace test
2222
2323class O1HeapMemoryResourceTest : public ::testing::Test
2424{
25- static constexpr std::size_t TestBufferSize = 0x100000 ;
25+ static constexpr std::size_t TestBufferSize = 0x4096 ;
2626
2727public:
2828 cetl::pmr::O1HeapAlignedStorage<TestBufferSize> large_buffer{};
2929};
3030
31- TEST_F (O1HeapMemoryResourceTest, TestDefault)
32- {
33- cetl::pmr::UnsynchronizedO1HeapMemoryResourceDelegate test_subject{large_buffer};
34- void * mem = test_subject.allocate (8 );
35- ASSERT_NE (nullptr , mem);
36- test_subject.deallocate (mem, 8 );
37- }
38-
3931TEST_F (O1HeapMemoryResourceTest, O1HeapAlignedStorageTest)
4032{
41- cetl::pmr::O1HeapAlignedStorage<4096 > aligned_storage{};
42- cetl::pmr::UnsynchronizedO1HeapMemoryResourceDelegate test_subject{aligned_storage};
33+ cetl::pmr::UnsynchronizedO1HeapMemoryResourceDelegate test_subject{large_buffer};
4334 void * mem = test_subject.allocate (16 );
4435 ASSERT_NE (nullptr , mem);
4536 test_subject.deallocate (mem, 16 );
@@ -89,12 +80,7 @@ TEST_F(O1HeapMemoryResourceTest, TestAllocationFailureThrowsBadAlloc)
8980 void * final_alloc = test_subject.allocate (64 );
9081 EXPECT_EQ (nullptr , final_alloc) << " Allocation should return nullptr when heap is exhausted" ;
9182#endif
92-
93- // Clean up allocations
94- for (void * mem : allocations)
95- {
96- test_subject.deallocate (mem, 64 );
97- }
83+ // Don't worry about deallocating memory since the allocator and small_buffer both go out of scope with the test.
9884}
9985
10086} // namespace test
0 commit comments