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