Lines Matching refs:tf
177 TemporaryFile tf; in TEST() local
178 ASSERT_EQ(0, close(tf.fd)); in TEST()
179 ASSERT_EQ(0, truncate(tf.path, 123)); in TEST()
182 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
187 TemporaryFile tf; in TEST() local
188 ASSERT_EQ(0, close(tf.fd)); in TEST()
189 ASSERT_EQ(0, truncate64(tf.path, 123)); in TEST()
192 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
197 TemporaryFile tf; in TEST() local
198 ASSERT_EQ(0, ftruncate(tf.fd, 123)); in TEST()
199 ASSERT_EQ(0, close(tf.fd)); in TEST()
202 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
207 TemporaryFile tf; in TEST() local
208 ASSERT_EQ(0, ftruncate64(tf.fd, 123)); in TEST()
209 ASSERT_EQ(0, close(tf.fd)); in TEST()
212 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
217 TemporaryFile tf; in TEST() local
219 ASSERT_EQ(-1, ftruncate(tf.fd, -123)); in TEST()
397 TemporaryFile tf; in TestSyncFunction() local
398 ASSERT_NE(-1, tf.fd); in TestSyncFunction()
400 EXPECT_EQ(0, fn(tf.fd)); in TestSyncFunction()
402 ASSERT_NE(-1, fd = open(tf.path, O_RDONLY)); in TestSyncFunction()
406 ASSERT_NE(-1, fd = open(tf.path, O_RDWR)); in TestSyncFunction()
752 TemporaryFile tf; in TEST() local
756 rc = pathconf(tf.path, _PC_ALLOC_SIZE_MIN); in TEST()
758 rc = pathconf(tf.path, _PC_REC_MIN_XFER_SIZE); in TEST()
760 rc = pathconf(tf.path, _PC_REC_XFER_ALIGN); in TEST()
763 rc = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN); in TEST()
765 rc = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE); in TEST()
767 rc = fpathconf(tf.fd, _PC_REC_XFER_ALIGN); in TEST()
1180 TemporaryFile tf; in TEST() local
1181 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1184 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1185 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1188 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1189 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1192 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1193 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1196 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1197 ASSERT_EQ(0, lockf64(tf.fd, F_ULOCK, file_size)); in TEST()
1203 TemporaryFile tf; in TEST() local
1204 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1207 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1208 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, 0)); in TEST()
1211 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1212 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1215 ASSERT_EQ(0, ftruncate(tf.fd, 2*file_size)); in TEST()
1218 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1219 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, 2*file_size)); in TEST()
1225 TemporaryFile tf; in TEST() local
1226 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1229 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1230 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, -file_size)); in TEST()
1233 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1234 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1240 TemporaryFile tf; in TEST() local
1241 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1244 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1245 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1252 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1253 ASSERT_EQ(-1, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1256 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1257 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1267 TemporaryFile tf; in TEST() local
1268 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1271 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1272 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size/2)); in TEST()
1279 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1280 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1282 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1283 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1286 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1287 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1295 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1296 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1473 TemporaryFile tf; in TEST() local
1474 ASSERT_TRUE(android::base::WriteStringToFile("#!" BIN_DIR "sh\necho script\n", tf.path)); in TEST()
1477 setenv("PATH", dirname(tf.path), 1); in TEST()
1480 eth.SetArgs({basename(tf.path), nullptr}); in TEST()
1484 ASSERT_EQ(-1, execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv())); in TEST()
1488 ASSERT_EQ(0, chmod(tf.path, 0777)); in TEST()
1492 ASSERT_EQ(-1, execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv())); in TEST()
1496 ASSERT_EQ(0, close(tf.fd)); in TEST()
1497 eth.Run([&]() { execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()
1500 ASSERT_TRUE(android::base::WriteStringToFile("echo script\n", tf.path)); in TEST()
1501 eth.Run([&]() { execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()
1505 eth.Run([&]() { execvpe(tf.path, eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()