Browse Source

[2088] Deallocate all memory in TestBadDeallocate unit test

Mukund Sivaraman 12 years ago
parent
commit
c9f90e89db
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/util/tests/memory_segment_local_unittest.cc

+ 6 - 0
src/lib/util/tests/memory_segment_local_unittest.cc

@@ -84,6 +84,12 @@ TEST(MemorySegmentLocal, TestBadDeallocate) {
     // This should throw as the size passed to deallocate() is larger
     // than what was allocated.
     EXPECT_THROW(segment->deallocate(ptr, 2048), isc::OutOfRange);
+
+    // This should not throw
+    EXPECT_NO_THROW(segment->deallocate(ptr, 1024));
+
+    // Now, we have an deallocated everything:
+    EXPECT_TRUE(segment->allMemoryDeallocated());
 }
 
 TEST(MemorySegmentLocal, TestNullDeallocate) {