• Home
  • Raw
  • Download

Lines Matching refs:file

48   FdFile file;  in TEST_F()  local
49 EXPECT_EQ(-1, file.Fd()); in TEST_F()
50 EXPECT_FALSE(file.IsOpened()); in TEST_F()
51 EXPECT_TRUE(file.GetPath().empty()); in TEST_F()
56 FdFile file(good_path, O_CREAT | O_WRONLY, true); in TEST_F() local
57 ASSERT_TRUE(file.IsOpened()); in TEST_F()
58 EXPECT_GE(file.Fd(), 0); in TEST_F()
59 EXPECT_TRUE(file.IsOpened()); in TEST_F()
60 EXPECT_FALSE(file.ReadOnlyMode()); in TEST_F()
61 EXPECT_EQ(0, file.Flush()); in TEST_F()
62 EXPECT_EQ(0, file.Close()); in TEST_F()
63 EXPECT_EQ(-1, file.Fd()); in TEST_F()
64 EXPECT_FALSE(file.IsOpened()); in TEST_F()
77 FdFile file(tmp.GetFilename(), O_RDONLY, false); in TEST_F() local
78 ASSERT_TRUE(file.IsOpened()); in TEST_F()
79 EXPECT_TRUE(file.ReadOnlyMode()); in TEST_F()
80 EXPECT_GE(file.Fd(), 0); in TEST_F()
82 EXPECT_FALSE(file.ReadFully(&buffer, 4)); in TEST_F()
93 FdFile file(tmp.GetFilename(), O_RDWR, false); in TEST_F() local
94 ASSERT_TRUE(file.IsOpened()); in TEST_F()
95 EXPECT_GE(file.Fd(), 0); in TEST_F()
96 EXPECT_FALSE(file.ReadOnlyMode()); in TEST_F()
105 EXPECT_TRUE(file.Write(ignore_prefix, sizeof(ignore_prefix), offset)); in TEST_F()
107 EXPECT_TRUE(file.Write(read_suffix, sizeof(read_suffix), offset)); in TEST_F()
109 ASSERT_EQ(file.Flush(), 0); in TEST_F()
113 EXPECT_TRUE(file.PreadFully(buffer, sizeof(read_suffix), offset)); in TEST_F()
116 ASSERT_EQ(file.Close(), 0); in TEST_F()
122 FdFile file(tmp.GetFilename(), O_RDWR, false); in TEST_F() local
123 ASSERT_GE(file.Fd(), 0); in TEST_F()
124 EXPECT_TRUE(file.IsOpened()); in TEST_F()
125 EXPECT_FALSE(file.ReadOnlyMode()); in TEST_F()
134 EXPECT_TRUE(file.PwriteFully(test_string, length, offset)); in TEST_F()
135 ASSERT_EQ(file.Flush(), 0); in TEST_F()
138 EXPECT_TRUE(file.PreadFully(&offset_read_string[0], length, offset)); in TEST_F()
141 EXPECT_TRUE(file.PreadFully(&read_string[0], length, 0u)); in TEST_F()
144 ASSERT_EQ(file.Close(), 0); in TEST_F()
178 FdFile file(tmp.GetFilename(), O_RDWR, false); in TEST_F() local
179 ASSERT_TRUE(file.IsOpened()); in TEST_F()
180 EXPECT_GE(file.Fd(), 0); in TEST_F()
182 int old_fd = file.Fd(); in TEST_F()
184 FdFile file2(std::move(file)); in TEST_F()
185 EXPECT_FALSE(file.IsOpened()); in TEST_F()
197 FdFile file(tmp.GetFilename(), O_RDONLY, false); in TEST_F() local
198 ASSERT_TRUE(file.ReadOnlyMode()); in TEST_F()
203 file2 = std::move(file); in TEST_F()
213 FdFile file(filename, O_RDWR, false); in TEST_F() local
214 ASSERT_TRUE(file.IsOpened()); in TEST_F()
215 EXPECT_GE(file.Fd(), 0); in TEST_F()
217 EXPECT_TRUE(file.WriteFully(&buffer, sizeof(buffer))); in TEST_F()
218 EXPECT_EQ(file.Flush(), 0); in TEST_F()
220 EXPECT_TRUE(file.Erase(true)); in TEST_F()
222 EXPECT_FALSE(file.IsOpened()); in TEST_F()
285 FdFile file(pipefd[1], true); in TEST_F() local
286 ASSERT_TRUE(file.WriteFully("foo", 3)); in TEST_F()
287 ASSERT_EQ(0, file.Flush()); in TEST_F()
288 ASSERT_EQ(0, file.FlushCloseOrErase()); in TEST_F()