Home
last modified time | relevance | path

Searched refs:utils (Results 1 – 25 of 172) sorted by relevance

1234567

/system/update_engine/common/
Dutils_unittest.cc44 EXPECT_EQ("12345", utils::ParseECVersion("fw_version=12345")); in TEST()
45 EXPECT_EQ("123456", utils::ParseECVersion( in TEST()
47 EXPECT_EQ("12345", utils::ParseECVersion("fw_version=12345")); in TEST()
48 EXPECT_EQ("00VFA616", utils::ParseECVersion( in TEST()
52 EXPECT_EQ("", utils::ParseECVersion("b=1231a fw_version a=fasd2")); in TEST()
56 EXPECT_FALSE(utils::WriteFile("/this/doesn't/exist", "hello", 5)); in TEST()
63 EXPECT_TRUE(utils::WriteFile(file.value().c_str(), "hello", 5)); in TEST()
66 EXPECT_TRUE(utils::ReadFile(file.value().c_str(), &readback)); in TEST()
72 EXPECT_FALSE(utils::ReadFile("/this/doesn't/exist", &empty)); in TEST()
84 EXPECT_TRUE(utils::WriteFile(file.value().c_str(), data.data(), data.size())); in TEST()
[all …]
Dhash_calculator_unittest.cc113 utils::MakeTempFile("data.XXXXXX", &data_path, nullptr)); in TEST_F()
115 ASSERT_TRUE(utils::WriteFile(data_path.c_str(), "hi", 2)); in TEST_F()
139 utils::MakeTempFile("data.XXXXXX", &data_path, nullptr)); in TEST_F()
141 ASSERT_TRUE(utils::WriteFile(data_path.c_str(), "hi", 2)); in TEST_F()
/system/update_engine/payload_generator/
Dtarjan_unittest.cc69 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_a)); in TEST()
70 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_b)); in TEST()
71 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_c)); in TEST()
72 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_d)); in TEST()
73 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_e)); in TEST()
81 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_f)); in TEST()
89 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_g)); in TEST()
90 EXPECT_TRUE(utils::VectorContainsValue(vertex_indexes, n_h)); in TEST()
Dextent_utils_unittest.cc57 EXPECT_EQ(0U, utils::BlocksInExtents(extents)); in TEST()
59 EXPECT_EQ(1U, utils::BlocksInExtents(extents)); in TEST()
61 EXPECT_EQ(56U, utils::BlocksInExtents(extents)); in TEST()
63 EXPECT_EQ(58U, utils::BlocksInExtents(extents)); in TEST()
67 EXPECT_EQ(0U, utils::BlocksInExtents(extents)); in TEST()
69 EXPECT_EQ(1U, utils::BlocksInExtents(extents)); in TEST()
71 EXPECT_EQ(56U, utils::BlocksInExtents(extents)); in TEST()
73 EXPECT_EQ(58U, utils::BlocksInExtents(extents)); in TEST()
Dcycle_breaker_unittest.cc86 EXPECT_TRUE(utils::SetContainsKey(broken_edges, make_pair(n_a, n_e)) || in TEST()
87 utils::SetContainsKey(broken_edges, make_pair(n_e, n_b)) || in TEST()
88 utils::SetContainsKey(broken_edges, make_pair(n_b, n_a))); in TEST()
89 EXPECT_TRUE(utils::SetContainsKey(broken_edges, make_pair(n_c, n_d)) || in TEST()
90 utils::SetContainsKey(broken_edges, make_pair(n_d, n_e)) || in TEST()
91 utils::SetContainsKey(broken_edges, make_pair(n_e, n_c))); in TEST()
92 EXPECT_TRUE(utils::SetContainsKey(broken_edges, make_pair(n_g, n_h)) || in TEST()
93 utils::SetContainsKey(broken_edges, make_pair(n_h, n_g))); in TEST()
220 EXPECT_TRUE(utils::SetContainsKey(broken_edges, make_pair(n_b, n_a))); in TEST()
221 EXPECT_TRUE(utils::SetContainsKey(broken_edges, make_pair(n_b, n_c))); in TEST()
[all …]
Ddeflate_utils.cc52 brillo::Blob data(utils::BlocksInExtents(extents) * block_size); in CopyExtentsToFile()
54 utils::ReadExtents(in_path, extents, &data, data.size(), block_size)); in CopyExtentsToFile()
56 utils::WriteFile(out_path.c_str(), data.data(), data.size())); in CopyExtentsToFile()
64 utils::BlocksInExtents(file.extents) >= in IsSquashfsImage()
68 utils::ReadFileChunk(part_path, in IsSquashfsImage()
91 num_blocks += utils::BlocksInExtents(in_file.extents); in RealignSplittedFiles()
95 TEST_AND_RETURN_FALSE(utils::BlocksInExtents(file.extents) == num_blocks); in RealignSplittedFiles()
115 if (utils::BlocksInExtents(base_extents) < in ShiftExtentsOverExtents()
116 utils::BlocksInExtents(*over_extents)) { in ShiftExtentsOverExtents()
165 utils::BlocksInExtents(base_extents) * kBlockSize); in ShiftBitExtentsOverExtents()
[all …]
Dpayload_file_unittest.cc40 EXPECT_TRUE(utils::MakeTempFile("ReorderBlobsTest.orig.XXXXXX", &orig_blobs, in TEST_F()
50 utils::WriteFile(orig_blobs.c_str(), orig_data.data(), orig_data.size())); in TEST_F()
54 utils::MakeTempFile("ReorderBlobsTest.new.XXXXXX", &new_blobs, nullptr)); in TEST_F()
79 EXPECT_TRUE(utils::ReadFile(new_blobs, &new_data)); in TEST_F()
Dext2_filesystem_unittest.cc162 utils::BlocksInExtents(map_files["/link-long_symlink"].extents)); in TEST_F()
172 EXPECT_EQ(1U, utils::BlocksInExtents(map_files["/regular-small"].extents)); in TEST_F()
174 1U, utils::BlocksInExtents(map_files["/regular-with_net_cap"].extents)); in TEST_F()
179 utils::BlocksInExtents(map_files["/sparse-16k-last_block"].extents)); in TEST_F()
182 utils::BlocksInExtents(map_files["/sparse-16k-first_block"].extents)); in TEST_F()
184 utils::BlocksInExtents(map_files["/sparse-16k-holes"].extents)); in TEST_F()
Dfull_update_generator_unittest.cc43 EXPECT_TRUE(utils::MakeTempFile("FullUpdateTest_partition.XXXXXX", in SetUp()
46 EXPECT_TRUE(utils::MakeTempFile("FullUpdateTest_blobs.XXXXXX", in SetUp()
120 utils::BlocksInExtents(aops[0].op.dst_extents())); in TEST_F()
122 utils::BlocksInExtents(aops[1].op.dst_extents())); in TEST_F()
142 utils::BlocksInExtents(aops[0].op.dst_extents())); in TEST_F()
Dblob_file_writer_unittest.cc36 EXPECT_TRUE(utils::MakeTempFile("BlobFileWriterTest.XXXXXX", in TEST()
50 ASSERT_TRUE(utils::PReadAll(blob_fd, in TEST()
/system/libvintf/
DAndroid.bp56 "utils-common.cpp",
60 "libhidl-gen-utils",
70 "libhidl-gen-utils",
87 // libvintf_common + utils.cpp
94 "libhidl-gen-utils",
104 "utils.cpp",
108 "libhidl-gen-utils",
119 "libhidl-gen-utils",
132 "libhidl-gen-utils",
DAndroid.mk26 libhidl-gen-utils \
29 LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libhidl-gen-utils
/system/update_engine/payload_consumer/
Dinstall_plan.cc63 utils::ToString(partition.run_postinstall).c_str()); in Dump()
89 << utils::ToString(hash_checks_mandatory) in Dump()
90 << ", powerwash_required: " << utils::ToString(powerwash_required) in Dump()
92 << utils::ToString(switch_slot_on_reboot) in Dump()
93 << ", run_post_install: " << utils::ToString(run_post_install); in Dump()
Dcached_file_descriptor_unittest.cc64 EXPECT_TRUE(utils::WriteFile( in SetUp()
92 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
105 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
126 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
154 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
167 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
183 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
200 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &blob_out)); in TEST_F()
Ddelta_performer_integration_test.cc132 EXPECT_TRUE(utils::ReadFile(a_file, &a_data)) << "file failed: " << a_file; in CompareFilesByBlock()
133 EXPECT_TRUE(utils::ReadFile(b_file, &b_data)) << "file failed: " << b_file; in CompareFilesByBlock()
165 EXPECT_TRUE(utils::PWriteAll(fd, "\0", 1, offset)); in WriteByteAtOffset()
213 ASSERT_TRUE(utils::MakeTempFile("key.XXXXXX", in SignGeneratedShellPayload()
244 ASSERT_TRUE(utils::MakeTempFile("hash.XXXXXX", &hash_file, nullptr)); in SignGeneratedShellPayload()
264 ASSERT_TRUE(utils::ReadFile(hash_file, &hash)); in SignGeneratedShellPayload()
268 ASSERT_TRUE(utils::MakeTempFile("signature.XXXXXX", &sig_file, nullptr)); in SignGeneratedShellPayload()
273 ASSERT_TRUE(utils::MakeTempFile("signature.XXXXXX", &sig_file2, nullptr)); in SignGeneratedShellPayload()
314 EXPECT_TRUE(utils::MakeTempFile("a_img.XXXXXX", &state->a_img, nullptr)); in GenerateDeltaFile()
315 EXPECT_TRUE(utils::MakeTempFile("b_img.XXXXXX", &state->b_img, nullptr)); in GenerateDeltaFile()
[all …]
Dfile_writer_unittest.cc40 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); in TEST()
49 EXPECT_TRUE(utils::ReadFile(path, &actual_data)); in TEST()
65 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); in TEST()
Dextent_writer_unittest.cc78 utils::FileSize(temp_file_.path())); in TEST_F()
81 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &result_file)); in TEST_F()
133 utils::FileSize(temp_file_.path())); in WriteAlignedExtents()
136 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &result_file)); in WriteAlignedExtents()
175 utils::FileSize(temp_file_.path())); in TestZeroPad()
178 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &result_file)); in TestZeroPad()
218 utils::FileSize(temp_file_.path())); in TEST_F()
221 EXPECT_TRUE(utils::ReadFile(temp_file_.path(), &resultant_data)); in TEST_F()
Dpostinstall_runner_action.cc109 utils::MakePartitionNameForMount(partition.target_path); in PerformPartitionPostinstall()
128 if (utils::IsMountpoint(fs_mount_dir_)) { in PerformPartitionPostinstall()
130 utils::UnmountFilesystem(fs_mount_dir_); in PerformPartitionPostinstall()
156 if (!utils::SetBlockDeviceReadOnly(mountable_device, true)) { in PerformPartitionPostinstall()
162 if (!utils::MountFilesystem(mountable_device, in PerformPartitionPostinstall()
179 << " is: " << utils::GetFileFormat(abs_path); in PerformPartitionPostinstall()
231 utils::ReadAll(progress_fd_, buf, arraysize(buf), &bytes_read, &eof); in OnProgressFdReady()
282 utils::UnmountFilesystem(fs_mount_dir_); in Cleanup()
Dfile_descriptor_utils.cc43 auto total_blocks = utils::BlocksInExtents(src_extents); in CommonHashExtents()
87 TEST_AND_RETURN_FALSE(utils::BlocksInExtents(src_extents) == in CopyAndHashExtents()
88 utils::BlocksInExtents(tgt_extents)); in CopyAndHashExtents()
Dfile_descriptor_utils_unittest.cc55 EXPECT_TRUE(utils::MakeTempFile("fd_tgt.XXXXXX", &tgt_path_, nullptr)); in SetUp()
62 EXPECT_TRUE(utils::ReadFile(tgt_path_, &target_contents)); in ExpectTarget()
67 utils::HexDumpString(expected_contents); in ExpectTarget()
69 utils::HexDumpString(target_contents); in ExpectTarget()
/system/update_engine/
Dmetrics_reporter_omaha.cc130 LOG(INFO) << "Uploading " << utils::FormatTimeDelta(os_age) << " for metric " in ReportDailyMetrics()
175 LOG(INFO) << "Sending " << utils::FormatTimeDelta(time_since_last) in ReportUpdateCheckMetrics()
189 LOG(INFO) << "Sending " << utils::FormatTimeDelta(uptime_since_last) in ReportUpdateCheckMetrics()
230 LOG(INFO) << "Uploading " << utils::ToString(payload_type) << " for metric " in ReportUpdateAttemptMetrics()
235 LOG(INFO) << "Uploading " << utils::FormatTimeDelta(duration) in ReportUpdateAttemptMetrics()
244 LOG(INFO) << "Uploading " << utils::FormatTimeDelta(duration_uptime) in ReportUpdateAttemptMetrics()
286 LOG(INFO) << "Sending " << utils::FormatTimeDelta(time_since_last) in ReportUpdateAttemptMetrics()
300 LOG(INFO) << "Sending " << utils::FormatTimeDelta(uptime_since_last) in ReportUpdateAttemptMetrics()
390 metric += utils::ToString(source); in ReportSuccessfulUpdateMetrics()
437 LOG(INFO) << "Uploading " << utils::FormatTimeDelta(total_duration) in ReportSuccessfulUpdateMetrics()
[all …]
Dpayload_state.cc256 ErrorCode base_error = utils::GetBaseErrorCode(error); in UpdateFailed()
258 << " (" << utils::ErrorCodeToString(base_error) << ")"; in UpdateFailed()
427 << utils::ToString(backoff_expiry_time_) in ShouldBackoffDownload()
433 << utils::ToString(backoff_expiry_time_); in ShouldBackoffDownload()
524 int fuzz_minutes = utils::FuzzInt(0, kMaxBackoffFuzzMinutes); in UpdateBackoffExpiryTime()
528 << utils::FormatTimeDelta(next_backoff_interval); in UpdateBackoffExpiryTime()
551 << utils::ToString(current_download_source_); in UpdateCurrentDownloadSource()
963 << utils::ToString(stored_time) in LoadBackoffExpiryTime()
974 << utils::ToString(backoff_expiry_time_); in SetBackoffExpiryTime()
1012 << utils::ToString(stored_time) in LoadUpdateTimestampStart()
[all …]
Dimage_properties_android.cc89 } else if (!utils::DeviceForMountPoint("/misc", &misc_device)) { in OpenMisc()
116 if (!utils::PReadAll( in ReadChannelFromMisc()
146 if (!utils::PWriteAll(fd, channel, kChannelSize, kChannelOffset)) { in WriteChannelToMisc()
192 utils::ReadFile(kProductComponentsPath, &result.product_components); in LoadImageProperties()
/system/tools/hidl/
DAndroid.bp104 "libhidl-gen-utils",
108 "libhidl-gen-utils",
136 "libhidl-gen-utils",
140 "libhidl-gen-utils",
158 "libhidl-gen-utils",
/system/libvintf/test/
DAndroid.bp34 "libhidl-gen-utils",
56 "utils-fake.cpp",
70 "libhidl-gen-utils",

1234567