Home
last modified time | relevance | path

Searched refs:tf (Results 1 – 25 of 27) sorted by relevance

12

/system/core/adb/
Dadb_io_test.cpp47 TemporaryFile tf; in POSIX_TEST() local
48 ASSERT_NE(-1, tf.fd); in POSIX_TEST()
50 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno); in POSIX_TEST()
51 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); in POSIX_TEST()
55 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno); in POSIX_TEST()
61 TemporaryFile tf; in POSIX_TEST() local
62 ASSERT_NE(-1, tf.fd); in POSIX_TEST()
64 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno); in POSIX_TEST()
65 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); in POSIX_TEST()
69 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf))); in POSIX_TEST()
[all …]
Dtest_device.py557 tf = tempfile.NamedTemporaryFile('wb', suffix=file_suffix,
559 tf.close()
563 output = self.device.install(tf.name)
568 os.remove(tf.name)
1198 tf = tempfile.NamedTemporaryFile('wb', suffix=name, delete=False)
1199 tf.close()
1200 self.device.push(tf.name, remote_path)
1201 os.remove(tf.name)
1202 self.assertFalse(os.path.exists(tf.name))
1210 self.device.pull(remote_path, tf.name)
[all …]
/system/core/libunwindstack/tests/
DDexFileTest.cpp39 TemporaryFile tf; in TEST() local
40 ASSERT_TRUE(tf.fd != -1); in TEST()
42 ASSERT_EQ(size_t{10}, static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, 10)))); in TEST()
45 EXPECT_TRUE(DexFileFromFile::Create(0, tf.path) == nullptr); in TEST()
48 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); in TEST()
50 static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(kDexData) - 1)))); in TEST()
51 EXPECT_TRUE(DexFileFromFile::Create(0, tf.path) == nullptr); in TEST()
55 TemporaryFile tf; in TEST() local
56 ASSERT_TRUE(tf.fd != -1); in TEST()
59 static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(kDexData))))); in TEST()
[all …]
DElfCacheTest.cpp40 void WriteElfFile(uint64_t offset, TemporaryFile* tf, uint32_t type) { in WriteElfFile() argument
56 ASSERT_EQ(offset, static_cast<uint64_t>(lseek(tf->fd, offset, SEEK_SET))); in WriteElfFile()
57 ASSERT_TRUE(android::base::WriteFully(tf->fd, ptr, ehdr_size)); in WriteElfFile()
74 TemporaryFile tf; in VerifySameMap() local
75 ASSERT_TRUE(tf.fd != -1); in VerifySameMap()
76 WriteElfFile(0, &tf, EM_ARM); in VerifySameMap()
77 close(tf.fd); in VerifySameMap()
81 MapInfo info1(nullptr, start, end, 0, 0x5, tf.path); in VerifySameMap()
82 MapInfo info2(nullptr, start, end, 0, 0x5, tf.path); in VerifySameMap()
109 TemporaryFile tf; in VerifyWithinSameMap() local
[all …]
DMapsTest.cpp356 TemporaryFile tf; in TEST() local
357 ASSERT_TRUE(tf.fd != -1); in TEST()
363 tf.path, 0660, getuid(), getgid())); in TEST()
365 FileMaps maps(tf.path); in TEST()
398 TemporaryFile tf; in TEST() local
399 ASSERT_TRUE(tf.fd != -1); in TEST()
405 tf.path, 0660, getuid(), getgid())); in TEST()
407 FileMaps maps(tf.path); in TEST()
447 TemporaryFile tf; in TEST() local
448 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
/system/core/base/
Dfile_test.cpp40 TemporaryFile tf; in TEST() local
41 ASSERT_TRUE(tf.fd != -1); in TEST()
42 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path)) in TEST()
45 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) in TEST()
72 TemporaryFile tf; in TEST() local
73 ASSERT_TRUE(tf.fd != -1); in TEST()
74 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path, 0660, in TEST()
78 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
83 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) in TEST()
90 TemporaryFile tf; in TEST() local
[all …]
Dmapped_file_test.cpp30 TemporaryFile tf; in TEST() local
31 ASSERT_TRUE(tf.fd != -1); in TEST()
32 ASSERT_TRUE(android::base::WriteStringToFd("hello world", tf.fd)); in TEST()
34 auto m = android::base::MappedFile::FromFd(tf.fd, 3, 2, PROT_READ); in TEST()
43 TemporaryFile tf; in TEST() local
44 ASSERT_TRUE(tf.fd != -1); in TEST()
46 auto m = android::base::MappedFile::FromFd(tf.fd, 4096, 0, PROT_READ); in TEST()
/system/core/libcutils/
Dandroid_get_control_file_test.cpp32 TemporaryFile tf; in TEST() local
33 ASSERT_GE(tf.fd, 0); in TEST()
36 key += tf.path; in TEST()
41 EXPECT_EQ(android_get_control_file(tf.path), -1); in TEST()
43 EXPECT_EQ(setenv(key.c_str(), android::base::StringPrintf("%d", tf.fd).c_str(), true), 0); in TEST()
45 EXPECT_EQ(android_get_control_file(tf.path), tf.fd); in TEST()
46 close(tf.fd); in TEST()
47 EXPECT_EQ(android_get_control_file(tf.path), -1); in TEST()
49 EXPECT_EQ(android_get_control_file(tf.path), -1); in TEST()
/system/extras/libperfmgr/tests/
DFileNodeTest.cc44 TemporaryFile tf; in TEST() local
45 FileNode t("t", tf.path, {{"value0"}, {"value1"}, {"value2"}}, 1, false); in TEST()
46 _VerifyPathValue(tf.path, ""); in TEST()
51 TemporaryFile tf; in TEST() local
52 FileNode t("t", tf.path, {{"value0"}, {"value1"}, {"value2"}}, 1, true); in TEST()
53 _VerifyPathValue(tf.path, "value1"); in TEST()
61 TemporaryFile tf; in TEST() local
62 FileNode t("test_dump", tf.path, {{"value0"}, {"value1"}, {"value2"}}, 1, in TEST()
68 android::base::StringPrintf("test_dump\t%s\t1\tvalue1\n", tf.path)); in TEST()
74 TemporaryFile tf; in TEST() local
[all …]
DNodeLooperThreadTest.cc37 std::unique_ptr<TemporaryFile> tf = std::make_unique<TemporaryFile>(); in SetUp() local
39 "n0", tf->path, {{"n0_value0"}, {"n0_value1"}, {"n0_value2"}}, 2, in SetUp()
41 files_.emplace_back(std::move(tf)); in SetUp()
42 tf = std::make_unique<TemporaryFile>(); in SetUp()
44 "n1", tf->path, {{"n1_value0"}, {"n1_value1"}, {"n1_value2"}}, 2, in SetUp()
46 files_.emplace_back(std::move(tf)); in SetUp()
DHintManagerTest.cc134 std::unique_ptr<TemporaryFile> tf = std::make_unique<TemporaryFile>(); in SetUp() local
136 "n0", tf->path, {{"n0_value0"}, {"n0_value1"}, {"n0_value2"}}, 2, in SetUp()
138 files_.emplace_back(std::move(tf)); in SetUp()
139 tf = std::make_unique<TemporaryFile>(); in SetUp()
141 "n1", tf->path, {{"n1_value0"}, {"n1_value1"}, {"n1_value2"}}, 2, in SetUp()
143 files_.emplace_back(std::move(tf)); in SetUp()
/system/core/init/
Dutil_test.cpp42 TemporaryFile tf; in TEST() local
43 ASSERT_TRUE(tf.fd != -1); in TEST()
44 EXPECT_TRUE(WriteFile(tf.path, s)) << strerror(errno); in TEST()
45 EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0620, AT_SYMLINK_NOFOLLOW)) << strerror(errno); in TEST()
46 auto file_contents = ReadFile(tf.path); in TEST()
53 TemporaryFile tf; in TEST() local
54 ASSERT_TRUE(tf.fd != -1); in TEST()
55 EXPECT_TRUE(WriteFile(tf.path, s)) << strerror(errno); in TEST()
56 EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0602, AT_SYMLINK_NOFOLLOW)) << strerror(errno); in TEST()
57 auto file_contents = ReadFile(tf.path); in TEST()
[all …]
Dpersistent_properties_test.cpp70 TemporaryFile tf; in TEST() local
71 ASSERT_TRUE(tf.fd != -1); in TEST()
72 persistent_property_filename = tf.path; in TEST()
93 TemporaryFile tf; in TEST() local
94 ASSERT_TRUE(tf.fd != -1); in TEST()
95 persistent_property_filename = tf.path; in TEST()
114 TemporaryFile tf; in TEST() local
115 ASSERT_TRUE(tf.fd != -1); in TEST()
116 persistent_property_filename = tf.path; in TEST()
136 TemporaryFile tf; in TEST() local
[all …]
Dueventd_parser_test.cpp58 TemporaryFile tf; in TestUeventdFile() local
59 ASSERT_TRUE(tf.fd != -1); in TestUeventdFile()
60 ASSERT_TRUE(android::base::WriteStringToFd(content, tf.fd)); in TestUeventdFile()
62 auto result = ParseConfig({tf.path}); in TestUeventdFile()
Dinit_test.cpp62 TemporaryFile tf; in TestInitText() local
63 ASSERT_TRUE(tf.fd != -1); in TestInitText()
64 ASSERT_TRUE(android::base::WriteStringToFd(init_script, tf.fd)); in TestInitText()
65 TestInit(tf.path, test_function_map, commands, service_list); in TestInitText()
Dcompare-bootcharts.py80 with tarfile.open(pathname + '/bootchart.tgz', 'r:*') as tf:
83 f = tf.extractfile('proc_ps.log')
/system/core/fs_mgr/tests/
Dfs_mgr_test.cpp208 TemporaryFile tf; in TEST() local
209 ASSERT_TRUE(tf.fd != -1); in TEST()
227 ASSERT_TRUE(android::base::WriteStringToFile(fstab_contents, tf.path)); in TEST()
230 EXPECT_TRUE(ReadFstabFromFile(tf.path, &fstab)); in TEST()
313 TemporaryFile tf; in TEST() local
314 ASSERT_TRUE(tf.fd != -1); in TEST()
323 ASSERT_TRUE(android::base::WriteStringToFile(fstab_contents, tf.path)); in TEST()
326 EXPECT_TRUE(ReadFstabFromFile(tf.path, &fstab)); in TEST()
392 TemporaryFile tf; in TEST() local
393 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
/system/core/libmeminfo/
Dlibmeminfo_test.cpp114 TemporaryFile tf; in TEST() local
115 ASSERT_TRUE(tf.fd != -1); in TEST()
116 ASSERT_TRUE(::android::base::WriteStringToFd(rollup, tf.fd)); in TEST()
119 ASSERT_EQ(SmapsOrRollupFromFile(tf.path, &stats), true); in TEST()
154 TemporaryFile tf; in TEST() local
155 ASSERT_TRUE(tf.fd != -1); in TEST()
156 ASSERT_TRUE(::android::base::WriteStringToFd(smaps, tf.fd)); in TEST()
159 ASSERT_EQ(SmapsOrRollupFromFile(tf.path, &stats), true); in TEST()
195 TemporaryFile tf; in TEST() local
196 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
Dlibmeminfo_benchmark.cpp161 TemporaryFile tf; in BM_ReadMemInfo_old() local
162 ::android::base::WriteStringToFd(meminfo, tf.fd); in BM_ReadMemInfo_old()
166 get_mem_info(mem, tf.path); in BM_ReadMemInfo_old()
217 TemporaryFile tf; in BM_ReadMemInfo_new() local
218 android::base::WriteStringToFd(meminfo, tf.fd); in BM_ReadMemInfo_new()
220 std::string file = std::string(tf.path); in BM_ReadMemInfo_new()
330 TemporaryFile tf; in BM_MemInfoWithZram_old() local
331 ::android::base::WriteStringToFd(meminfo, tf.fd); in BM_MemInfoWithZram_old()
336 get_mem_info(mem, tf.path); in BM_MemInfoWithZram_old()
389 TemporaryFile tf; in BM_MemInfoWithZram_new() local
[all …]
/system/core/libutils/
DFileMap_test.cpp26 TemporaryFile tf; in TEST() local
27 ASSERT_TRUE(tf.fd != -1); in TEST()
30 ASSERT_TRUE(m.create("test", tf.fd, 4096, 0, true)); in TEST()
/system/core/debuggerd/libdebuggerd/test/
Dopen_files_list_test.cpp32 TemporaryFile tf; in TEST() local
41 if (file.first == tf.fd) { in TEST()
42 EXPECT_EQ(file.second.path.value_or(""), std::string(tf.path)); in TEST()
/system/core/adb/sysdeps/
Dstat_test.cpp27 TemporaryFile tf; in TEST() local
54 ASSERT_EQ(0, stat(tf.path, &st)); in TEST()
58 ASSERT_EQ(-1, stat((std::string(tf.path) + '/').c_str(), &st)); in TEST()
62 ASSERT_EQ(-1, stat((std::string(tf.path) + '\\').c_str(), &st)); in TEST()
/system/extras/verity/
Dverity_verifier.cpp94 TemporaryFile tf; in main() local
95 if (sparse_file_write(file, tf.fd, false, false, false) < 0) { in main()
102 fec::io input(tf.path); in main()
/system/core/fs_mgr/liblp/
Dimages.cpp425 TemporaryFile tf; in OpenImageFile() local
426 if (tf.fd < 0) { in OpenImageFile()
432 int rv = sparse_file_write(source.get(), tf.fd, false, false, false); in OpenImageFile()
437 temp_fds_.push_back(android::base::unique_fd(tf.release())); in OpenImageFile()
/system/core/libmeminfo/libdmabufinfo/
Ddmabufinfo_test.cpp198 TemporaryFile tf; in TEST() local
199 ASSERT_TRUE(tf.fd != -1); in TEST()
200 ASSERT_TRUE(::android::base::WriteStringToFd(bufinfo, tf.fd)); in TEST()
201 std::string path = std::string(tf.path); in TEST()

12