]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2831] Make some more minor comment updates
authorMukund Sivaraman <muks@isc.org>
Tue, 9 Apr 2013 07:49:28 +0000 (13:19 +0530)
committerMukund Sivaraman <muks@isc.org>
Tue, 9 Apr 2013 07:49:28 +0000 (13:19 +0530)
src/lib/util/tests/memory_segment_mapped_unittest.cc

index d006fc46ac131d38557f6268042f8224092056ff..812f38c5e7aec0ac95b62d3df92a103ab5dabaed 100644 (file)
@@ -84,7 +84,8 @@ TEST_F(MemorySegmentMappedTest, createAndModify) {
 
         EXPECT_TRUE(segment_->allMemoryDeallocated());
 
-        // re-open it.
+        // re-open it in read-write mode, but don't try to create it
+        // this time.
         segment_.reset(new MemorySegmentMapped(mapped_file, false));
     }
 }
@@ -103,22 +104,24 @@ TEST_F(MemorySegmentMappedTest, openFail) {
     // The given file is directory
     EXPECT_THROW(MemorySegmentMapped("/", true), MemorySegmentOpenError);
 
-    // file doesn't exist and directory isn't writable (we assume the root
-    // directory is not writable for the user running the test).
-    EXPECT_THROW(MemorySegmentMapped("/test.mapped", true),
+    // file doesn't exist and directory isn't writable (we assume the
+    // following path is not writable for the user running the test).
+    EXPECT_THROW(MemorySegmentMapped("/random-glkwjer098/test.mapped", true),
                  MemorySegmentOpenError);
 
-    // file doesn't exist and it's read-only (so open-only)
+    // It should fail when file doesn't exist and it's read-only (so
+    // open-only).
     EXPECT_THROW(MemorySegmentMapped(TEST_DATA_BUILDDIR "/nosuchfile.mapped"),
                  MemorySegmentOpenError);
-    // Likewise.  read-write mode but creation is suppressed.
+    // Likewise, it should fail in read-write mode when creation is
+    // suppressed.
     EXPECT_THROW(MemorySegmentMapped(TEST_DATA_BUILDDIR "/nosuchfile.mapped",
                                      false),
                  MemorySegmentOpenError);
 
-    // Close the segment, break the file with bogus data, and try to reopen.
-    // It should fail with exception whether in the read-only or read-write,
-    // or "create if not exist" mode.
+    // Close the existing segment, break its file with bogus data, and
+    // try to reopen.  It should fail with exception whether in the
+    // read-only or read-write, or "create if not exist" mode.
     segment_.reset();
     std::ofstream ofs(mapped_file, std::ios::trunc);
     ofs << std::string(1024, 'x');