Parcourir la source

[2088] Deallocate all memory in TestBadDeallocate unit test

Mukund Sivaraman il y a 12 ans
Parent
commit
c9f90e89db
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  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) {