From 49222dc0c7ba1d426de608d45272093e0785d710 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 23 Sep 2014 07:58:23 -0700 Subject: [PATCH] Improve allocator test --- test/format-test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {