Lines Matching refs:tf
175 TemporaryFile tf; in TEST() local
176 ASSERT_EQ(0, close(tf.fd)); in TEST()
177 ASSERT_EQ(0, truncate(tf.path, 123)); in TEST()
180 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
185 TemporaryFile tf; in TEST() local
186 ASSERT_EQ(0, close(tf.fd)); in TEST()
187 ASSERT_EQ(0, truncate64(tf.path, 123)); in TEST()
190 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
195 TemporaryFile tf; in TEST() local
196 ASSERT_EQ(0, ftruncate(tf.fd, 123)); in TEST()
197 ASSERT_EQ(0, close(tf.fd)); in TEST()
200 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
205 TemporaryFile tf; in TEST() local
206 ASSERT_EQ(0, ftruncate64(tf.fd, 123)); in TEST()
207 ASSERT_EQ(0, close(tf.fd)); in TEST()
210 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
215 TemporaryFile tf; in TEST() local
217 ASSERT_EQ(-1, ftruncate(tf.fd, -123)); in TEST()
395 TemporaryFile tf; in TestSyncFunction() local
396 ASSERT_NE(-1, tf.fd); in TestSyncFunction()
398 EXPECT_EQ(0, fn(tf.fd)); in TestSyncFunction()
400 ASSERT_NE(-1, fd = open(tf.path, O_RDONLY)); in TestSyncFunction()
404 ASSERT_NE(-1, fd = open(tf.path, O_RDWR)); in TestSyncFunction()
756 TemporaryFile tf; in TEST() local
760 rc = pathconf(tf.path, _PC_ALLOC_SIZE_MIN); in TEST()
762 rc = pathconf(tf.path, _PC_REC_MIN_XFER_SIZE); in TEST()
764 rc = pathconf(tf.path, _PC_REC_XFER_ALIGN); in TEST()
767 rc = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN); in TEST()
769 rc = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE); in TEST()
771 rc = fpathconf(tf.fd, _PC_REC_XFER_ALIGN); in TEST()
1184 TemporaryFile tf; in TEST() local
1185 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1188 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1189 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1192 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1193 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1196 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1197 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1200 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1201 ASSERT_EQ(0, lockf64(tf.fd, F_ULOCK, file_size)); in TEST()
1207 TemporaryFile tf; in TEST() local
1208 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1211 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1212 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, 0)); in TEST()
1215 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1216 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1219 ASSERT_EQ(0, ftruncate(tf.fd, 2*file_size)); in TEST()
1222 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1223 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, 2*file_size)); in TEST()
1229 TemporaryFile tf; in TEST() local
1230 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1233 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1234 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, -file_size)); in TEST()
1237 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1238 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1244 TemporaryFile tf; in TEST() local
1245 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1248 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1249 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1256 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1257 ASSERT_EQ(-1, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1260 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1261 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1271 TemporaryFile tf; in TEST() local
1272 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1275 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1276 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size/2)); in TEST()
1283 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1284 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, 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()
1290 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1291 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1299 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1300 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1458 TemporaryFile tf; in TEST() local
1459 ASSERT_TRUE(android::base::WriteStringToFile("#!" BIN_DIR "sh\necho script\n", tf.path)); in TEST()
1462 setenv("PATH", dirname(tf.path), 1); in TEST()
1465 eth.SetArgs({basename(tf.path), nullptr}); in TEST()
1469 ASSERT_EQ(-1, execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv())); in TEST()
1473 ASSERT_EQ(0, chmod(tf.path, 0777)); in TEST()
1477 ASSERT_EQ(-1, execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv())); in TEST()
1481 ASSERT_EQ(0, close(tf.fd)); in TEST()
1482 eth.Run([&]() { execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()
1485 ASSERT_TRUE(android::base::WriteStringToFile("echo script\n", tf.path)); in TEST()
1486 eth.Run([&]() { execvpe(basename(tf.path), eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()
1490 eth.Run([&]() { execvpe(tf.path, eth.GetArgs(), eth.GetEnv()); }, 0, "script\n"); in TEST()