Home
last modified time | relevance | path

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

12

/system/libbase/
Dfile_test.cpp47 TemporaryFile tf; in TEST() local
48 ASSERT_NE(tf.fd, -1) << tf.path; in TEST()
49 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path)) in TEST()
52 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) in TEST()
79 TemporaryFile tf; in TEST() local
80 ASSERT_NE(tf.fd, -1) << tf.path; in TEST()
81 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path, 0660, in TEST()
85 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST()
90 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) in TEST()
117 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/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()
39 TemporaryFile tf; in TEST() local
40 ASSERT_TRUE(tf.fd != -1); in TEST()
45 ASSERT_EQ(offset, lseek64(tf.fd, offset, SEEK_SET)); in TEST()
47 ASSERT_EQ(1, write(tf.fd, &value, 1)); in TEST()
50 ASSERT_TRUE(m.create("test", tf.fd, offset, 0, true)); in TEST()
59 TemporaryFile tf; in TEST() local
60 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
DFileMap_fuzz.cpp27 TemporaryFile tf; in LLVMFuzzerTestOneInput() local
34 android::base::WriteStringToFd(bytes, tf.fd); in LLVMFuzzerTestOneInput()
42 m.create(orig_name.c_str(), tf.fd, offset, length, read_only); in LLVMFuzzerTestOneInput()
DPrinter_fuzz.cpp38 TemporaryFile tf; in LLVMFuzzerTestOneInput() local
39 android::FdPrinter filePrinter = android::FdPrinter(tf.fd, indent, prefix.c_str()); in LLVMFuzzerTestOneInput()
/system/unwinding/libunwindstack/tests/
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, nullptr, start, end, 0, 0x5, tf.path); in VerifySameMap()
82 MapInfo info2(nullptr, nullptr, start, end, 0, 0x5, tf.path); in VerifySameMap()
109 TemporaryFile tf; in VerifyWithinSameMap() local
[all …]
DDexFileTest.cpp53 TemporaryFile tf; in TEST() local
54 ASSERT_TRUE(tf.fd != -1); in TEST()
57 static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(kDexData))))); in TEST()
63 MapInfo info(nullptr, nullptr, 0, 0x10000, 0, 0x5, tf.path); in TEST()
83 TemporaryFile tf; in TEST() local
84 ASSERT_TRUE(tf.fd != -1); in TEST()
86 ASSERT_EQ(0x500, lseek(tf.fd, 0x500, SEEK_SET)); in TEST()
88 static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(kDexData))))); in TEST()
91 MapInfo info(nullptr, nullptr, 0, 0x10000, 0, 0x5, tf.path); in TEST()
96 TemporaryFile tf; in TEST() local
[all …]
DLocalUpdatableMapsTest.cpp52 TemporaryFile tf; in SetUp() local
53 ASSERT_TRUE(android::base::WriteStringToFile(GetDefaultMapString(), tf.path)); in SetUp()
55 maps_.TestSetMapsFile(tf.path); in SetUp()
80 TemporaryFile tf; in TEST_F() local
81 ASSERT_TRUE(android::base::WriteStringToFile(GetDefaultMapString(), tf.path)); in TEST_F()
83 maps_.TestSetMapsFile(tf.path); in TEST_F()
106 TemporaryFile tf; in TEST_F() local
110 tf.path)); in TEST_F()
112 maps_.TestSetMapsFile(tf.path); in TEST_F()
144 TemporaryFile tf; in TEST_F() 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/init/
Dutil_test.cpp42 TemporaryFile tf; in TEST() local
43 ASSERT_TRUE(tf.fd != -1); in TEST()
44 EXPECT_RESULT_OK(WriteFile(tf.path, s)); 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_RESULT_OK(WriteFile(tf.path, s)); 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()
94 TemporaryFile tf; in TEST() local
95 ASSERT_TRUE(tf.fd != -1); in TEST()
96 persistent_property_filename = tf.path; in TEST()
116 TemporaryFile tf; in TEST() local
117 ASSERT_TRUE(tf.fd != -1); in TEST()
118 persistent_property_filename = tf.path; in TEST()
139 TemporaryFile tf; in TEST() local
[all …]
Dinit_test.cpp69 TemporaryFile tf; in TestInitText() local
70 ASSERT_TRUE(tf.fd != -1); in TestInitText()
71 ASSERT_TRUE(android::base::WriteStringToFd(init_script, tf.fd)); in TestInitText()
72 TestInit(tf.path, test_function_map, commands, service_list); in TestInitText()
107 TemporaryFile tf; in TEST() local
108 ASSERT_TRUE(tf.fd != -1); in TEST()
109 ASSERT_TRUE(android::base::WriteStringToFd(init_script, tf.fd)); in TEST()
116 ASSERT_TRUE(parser.ParseConfig(tf.path)); in TEST()
259 TemporaryFile tf; in TEST() local
260 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
Dreboot_test.cpp109 TemporaryFile tf; in AddTestService() local
110 ASSERT_TRUE(tf.fd != -1); in AddTestService()
111 ASSERT_TRUE(WriteStringToFd(script, tf.fd)); in AddTestService()
112 ASSERT_TRUE(parser.ParseConfig(tf.path)); in AddTestService()
Dcompare-bootcharts.py80 with tarfile.open(pathname + '/bootchart.tgz', 'r:*') as tf:
83 f = tf.extractfile('proc_ps.log')
Dueventd_parser_test.cpp67 TemporaryFile tf; in TestUeventdFile() local
68 ASSERT_TRUE(tf.fd != -1); in TestUeventdFile()
69 ASSERT_TRUE(android::base::WriteStringToFd(content, tf.fd)); in TestUeventdFile()
71 auto result = ParseConfig({tf.path}); in TestUeventdFile()
/system/core/fs_mgr/tests/
Dfs_mgr_test.cpp325 TemporaryFile tf; in TEST() local
326 ASSERT_TRUE(tf.fd != -1); in TEST()
344 ASSERT_TRUE(android::base::WriteStringToFile(fstab_contents, tf.path)); in TEST()
347 EXPECT_TRUE(ReadFstabFromFile(tf.path, &fstab)); in TEST()
411 TemporaryFile tf; in TEST() local
412 ASSERT_TRUE(tf.fd != -1); in TEST()
421 ASSERT_TRUE(android::base::WriteStringToFile(fstab_contents, tf.path)); in TEST()
424 EXPECT_TRUE(ReadFstabFromFile(tf.path, &fstab)); in TEST()
488 TemporaryFile tf; in TEST() local
489 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
/system/memory/libmeminfo/
Dlibmeminfo_test.cpp242 TemporaryFile tf; in TEST() local
243 ASSERT_TRUE(tf.fd != -1); in TEST()
244 ASSERT_TRUE(::android::base::WriteStringToFd(rollup, tf.fd)); in TEST()
247 ASSERT_EQ(SmapsOrRollupFromFile(tf.path, &stats), true); in TEST()
282 TemporaryFile tf; in TEST() local
283 ASSERT_TRUE(tf.fd != -1); in TEST()
284 ASSERT_TRUE(::android::base::WriteStringToFd(smaps, tf.fd)); in TEST()
287 ASSERT_EQ(SmapsOrRollupFromFile(tf.path, &stats), true); in TEST()
323 TemporaryFile tf; in TEST() local
324 ASSERT_TRUE(tf.fd != -1); in TEST()
[all …]
Dlibmeminfo_benchmark.cpp163 TemporaryFile tf; in BM_ReadMemInfo_old() local
164 ::android::base::WriteStringToFd(meminfo, tf.fd); in BM_ReadMemInfo_old()
168 get_mem_info(mem, tf.path); in BM_ReadMemInfo_old()
219 TemporaryFile tf; in BM_ReadMemInfo_new() local
220 android::base::WriteStringToFd(meminfo, tf.fd); in BM_ReadMemInfo_new()
222 std::string file = std::string(tf.path); in BM_ReadMemInfo_new()
333 TemporaryFile tf; in BM_MemInfoWithZram_old() local
334 ::android::base::WriteStringToFd(meminfo, tf.fd); in BM_MemInfoWithZram_old()
339 get_mem_info(mem, tf.path); in BM_MemInfoWithZram_old()
392 TemporaryFile tf; in BM_MemInfoWithZram_new() local
[all …]
/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/libpackagelistparser/
Dpackagelistparser_test.cpp26 TemporaryFile tf; in TEST() local
37 tf.path); in TEST()
41 tf.path, in TEST()
93 TemporaryFile tf; in TEST() local
98 tf.path); in TEST()
102 tf.path, 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/libprocinfo/
Dprocess_map_test.cpp89 TemporaryFile tf; in VerifyReadMapFileAsyncSafe() local
90 ASSERT_TRUE(android::base::WriteStringToFd(maps_data, tf.fd)); in VerifyReadMapFileAsyncSafe()
118 android::procinfo::ReadMapFileAsyncSafe(tf.path, buffer.data(), buffer.size(), callback); in VerifyReadMapFileAsyncSafe()
265 TemporaryFile tf; in TEST() local
267 "0a0000-0c0000 rwxp 00000001 00:05 100 /fake/lib.so\n", tf.fd)); in TEST()
278 bool parsed = android::procinfo::ReadMapFileAsyncSafe(tf.path, buffer, sizeof(buffer), callback); in TEST()
/system/testing/gtest_extras/tests/
DOptionsTest.cpp548 TemporaryFile tf; in TEST_F() local
554 tf.path)); in TEST_F()
557 flag += tf.path; in TEST_F()
568 TemporaryFile tf; in TEST_F() local
569 ASSERT_TRUE(android::base::WriteStringToFile("--gtest_color=no", tf.path)); in TEST_F()
572 flag += tf.path; in TEST_F()
581 TemporaryFile tf; in TEST_F() local
584 flag += tf.path; in TEST_F()
592 TemporaryFile tf; in TEST_F() local
593 ASSERT_TRUE(android::base::WriteStringToFile("-j1\n", tf.path)); in TEST_F()
[all …]
DSystemTests.cpp910 TemporaryFile tf; in TEST_F() local
911 ASSERT_TRUE(tf.fd != -1); in TEST_F()
912 close(tf.fd); in TEST_F()
913 tmp_arg += tf.path; in TEST_F()
919 FILE* xml_file = fopen(tf.path, "r"); in TEST_F()
929 unlink(tf.path); in TEST_F()
1316 TemporaryFile tf; in TEST_F() local
1317 ASSERT_TRUE(android::base::WriteStringToFile("--gtest_print_time=0\n", tf.path)); in TEST_F()
1319 flagfile += tf.path; in TEST_F()

12