diff --git a/test/format-test.cc b/test/format-test.cc index 1eb8b36f..b7c28175 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -468,14 +468,16 @@ TEST(WriterTest, MoveAssignment) { #endif // FMT_USE_RVALUE_REFERENCES TEST(WriterTest, Allocator) { - typedef AllocatorRef< MockAllocator > TestAllocator; - MockAllocator alloc; + typedef testing::StrictMock< MockAllocator > MockAllocator; + typedef AllocatorRef TestAllocator; + MockAllocator alloc; BasicWriter w((TestAllocator(&alloc))); std::size_t size = 1.5 * fmt::internal::INLINE_BUFFER_SIZE; std::vector mem(size); EXPECT_CALL(alloc, allocate(size)).WillOnce(Return(&mem[0])); for (int i = 0; i < fmt::internal::INLINE_BUFFER_SIZE + 1; ++i) w << '*'; + EXPECT_CALL(alloc, deallocate(&mem[0], size)); } TEST(WriterTest, Data) {