Lines Matching defs:file
5 * you may not use this file except in compliance with the License.
44 FdFile file;
45 EXPECT_EQ(-1, file.Fd());
46 EXPECT_FALSE(file.IsOpened());
47 EXPECT_TRUE(file.GetPath().empty());
51 std::string good_path(GetTmpPath("some-file.txt"));
52 FdFile file;
53 ASSERT_TRUE(file.Open(good_path, O_CREAT | O_WRONLY));
54 EXPECT_GE(file.Fd(), 0);
55 EXPECT_TRUE(file.IsOpened());
56 EXPECT_EQ(0, file.Flush());
57 EXPECT_EQ(0, file.Close());
58 EXPECT_EQ(-1, file.Fd());
59 EXPECT_FALSE(file.IsOpened());
60 EXPECT_TRUE(file.Open(good_path, O_RDONLY));
61 EXPECT_GE(file.Fd(), 0);
62 EXPECT_TRUE(file.IsOpened());
64 ASSERT_EQ(file.Close(), 0);
69 // New scratch file, zero-length.
71 FdFile file;
72 ASSERT_TRUE(file.Open(tmp.GetFilename(), O_RDONLY));
73 EXPECT_GE(file.Fd(), 0);
74 EXPECT_TRUE(file.IsOpened());
76 EXPECT_FALSE(file.ReadFully(&buffer, 4));