test/VersionDictionary_test.cpp
changeset 9 629f61203db1
parent 8 21a6c17f4e3e
     1.1 --- a/test/VersionDictionary_test.cpp	Mon Sep 28 23:39:08 2009 -0700
     1.2 +++ b/test/VersionDictionary_test.cpp	Tue Sep 29 15:46:42 2009 -0700
     1.3 @@ -46,16 +46,16 @@
     1.4  
     1.5  TEST(File,HasPath) {
     1.6      {
     1.7 -        File f("/tmp/jubba", O_RDWR | O_CREAT | O_TRUNC, true);
     1.8 +        File f("/tmp/jubba", O_RDWR | O_CREAT | O_TRUNC);
     1.9          f.write("howdy");
    1.10      }
    1.11      {
    1.12 -        File f("/tmp/jubba", O_RDWR, true);
    1.13 +        File f("/tmp/jubba", O_RDWR);
    1.14          EXPECT_TRUE(f.hasPath("/tmp/jubba"));
    1.15          File::unlink("/tmp/jubba");
    1.16          EXPECT_FALSE(f.hasPath("/tmp/jubba"));
    1.17  
    1.18 -        File f2("/tmp/jubba", O_RDWR | O_CREAT | O_TRUNC, true);
    1.19 +        File f2("/tmp/jubba", O_RDWR | O_CREAT | O_TRUNC);
    1.20          f2.write("howdy");
    1.21          f2.flush();
    1.22  
    1.23 @@ -108,7 +108,7 @@
    1.24      time_t startTime = ::time(NULL);
    1.25      time_t createTime;
    1.26      {
    1.27 -        File file("/tmp/hashfiletest", O_RDWR | O_CREAT | O_TRUNC, true);
    1.28 +        File file("/tmp/hashfiletest", O_RDWR | O_CREAT | O_TRUNC);
    1.29          VersionDictionary *hf;
    1.30          {
    1.31              Timer t("Creating & writing VersionDictionary", nWords);
    1.32 @@ -124,7 +124,7 @@
    1.33          delete hf;
    1.34      }
    1.35      {
    1.36 -        File file("/tmp/hashfiletest");
    1.37 +        File file("/tmp/hashfiletest", O_RDONLY);
    1.38          VersionDictionary hf(&file);
    1.39          ASSERT_EQ(0, hf.generation());
    1.40          ASSERT_EQ(createTime, hf.timestamp());
    1.41 @@ -152,7 +152,7 @@
    1.42      }
    1.43      {
    1.44          printf("Opening OverlayVersionDictionary...\n");
    1.45 -        File file("/tmp/hashfiletest", O_RDWR, true);
    1.46 +        File file("/tmp/hashfiletest", O_RDWR);
    1.47          OverlayVersionDictionary hf(&file);
    1.48          EXPECT_EQ( nWords ,  hf.count() );
    1.49          EXPECT_TRUE(hf.get("abatement").equals("abatement"));
    1.50 @@ -196,7 +196,7 @@
    1.51      }
    1.52      {
    1.53          printf("Re-opening OverlayVersionDictionary...\n");
    1.54 -        File file("/tmp/hashfiletest");
    1.55 +        File file("/tmp/hashfiletest", O_RDONLY);
    1.56          OverlayVersionDictionary hf(&file);
    1.57          
    1.58          ASSERT_EQ(1, hf.generation());
    1.59 @@ -222,17 +222,17 @@
    1.60      }
    1.61      {
    1.62          printf("Writing VersionDictionary to a new file...\n");
    1.63 -        File oldFile("/tmp/hashfiletest");
    1.64 +        File oldFile("/tmp/hashfiletest", O_RDONLY);
    1.65          OverlayVersionDictionary oldhf(&oldFile);
    1.66          
    1.67 -        File newFile("/tmp/hashfiletest2", O_RDWR | O_CREAT | O_TRUNC, true);
    1.68 +        File newFile("/tmp/hashfiletest2", O_RDWR | O_CREAT | O_TRUNC);
    1.69          newFile.write("Ha5h", 4);     // VersionDictionary won't write to an empty file
    1.70          oldhf.saveAs(&newFile);
    1.71          printf("File size: %llu bytes\n", newFile.length());
    1.72      }
    1.73      {
    1.74          printf("Opening new file...\n");
    1.75 -        File file("/tmp/hashfiletest2");
    1.76 +        File file("/tmp/hashfiletest2", O_RDONLY);
    1.77          OverlayVersionDictionary hf(&file);
    1.78          
    1.79          EXPECT_EQ( nWords ,  hf.count() );