Home | History | Annotate | Download | only in base

Lines Matching refs:tf

38   TemporaryFile tf;
39 ASSERT_TRUE(tf.fd != -1);
40 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path))
43 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s))
70 TemporaryFile tf;
71 ASSERT_TRUE(tf.fd != -1);
72 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path, 0660,
76 ASSERT_EQ(0, stat(tf.path, &sb));
81 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s))
88 TemporaryFile tf;
89 ASSERT_TRUE(tf.fd != -1);
90 ASSERT_TRUE(android::base::WriteStringToFd("abc", tf.fd));
92 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << strerror(errno);
95 ASSERT_TRUE(android::base::ReadFdToString(tf.fd, &s)) << strerror(errno);
100 TemporaryFile tf;
101 ASSERT_TRUE(tf.fd != -1);
102 ASSERT_TRUE(android::base::WriteFully(tf.fd, "abc", 3));
104 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << strerror(errno);
108 ASSERT_TRUE(android::base::ReadFully(tf.fd, &s[0], s.size()))
112 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << strerror(errno);
115 ASSERT_FALSE(android::base::ReadFully(tf.fd, &s[0], s.size()));
119 TemporaryFile tf;
120 ASSERT_TRUE(tf.fd != -1);
121 close(tf.fd);
122 tf.fd = -1;
124 ASSERT_TRUE(android::base::RemoveFileIfExists(tf.path, &err)) << err;
125 ASSERT_TRUE(android::base::RemoveFileIfExists(tf.path));
219 TemporaryFile tf;
220 ASSERT_TRUE(tf.fd != -1);
225 ASSERT_TRUE(android::base::WriteStringToFile(std::string(size, 'x'), tf.path));
226 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s));
232 ASSERT_TRUE(android::base::WriteStringToFile(std::string(size, 'x'), tf.path));
233 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s));
239 ASSERT_TRUE(android::base::WriteStringToFile(std::string(size, 'x'), tf.path));
240 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s));
246 TemporaryFile tf;
247 ASSERT_TRUE(tf.fd != -1);
255 ASSERT_TRUE(android::base::WriteStringToFile("", tf.path));
256 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s));