Browse Source

[2831] reverted the change for deleting checkNamedData().

the order of deletion was intentional; BOOST_FOREACH for map wouldn't work
that way.
JINMEI Tatuya 12 years ago
parent
commit
8297b3a742
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/lib/util/tests/memory_segment_mapped_unittest.cc

+ 6 - 3
src/lib/util/tests/memory_segment_mapped_unittest.cc

@@ -357,9 +357,12 @@ TEST_F(MemorySegmentMappedTest, namedAddress) {
         checkNamedData(it->first, it->second, *segment_);
     }
 
-    // Confirm they are still valid, while we shrink the segment
-    BOOST_FOREACH(TestData::value_type e, data_list) {
-        checkNamedData(e.first, e.second, *segment_, true);
+    // Confirm they are still valid, while we shrink the segment.  We'll
+    // intentionally delete bigger data first so it'll be more likely that
+    // shrink has some real effect.
+    const char* const names[] = { "data3", "data2", "data1", NULL };
+    for (int i = 0; names[i]; ++i) {
+        checkNamedData(names[i], data_list[names[i]], *segment_, true);
         segment_->shrinkToFit();
     }
 }