/system/update_engine/payload_generator/ |
D | extent_utils_unittest.cc | 34 vector<Extent> extents; in TEST() local 36 EXPECT_EQ(0U, extents.size()); in TEST() 37 AppendBlockToExtents(&extents, kSparseHole); in TEST() 38 EXPECT_EQ(1U, extents.size()); in TEST() 39 AppendBlockToExtents(&extents, 0); in TEST() 40 EXPECT_EQ(2U, extents.size()); in TEST() 41 AppendBlockToExtents(&extents, kSparseHole); in TEST() 42 AppendBlockToExtents(&extents, kSparseHole); in TEST() 44 ASSERT_EQ(3U, extents.size()); in TEST() 45 EXPECT_EQ(kSparseHole, extents[0].start_block()); in TEST() [all …]
|
D | extent_utils.cc | 36 void AppendBlockToExtents(vector<Extent>* extents, uint64_t block) { in AppendBlockToExtents() argument 38 if (!extents->empty()) { in AppendBlockToExtents() 39 Extent& extent = extents->back(); in AppendBlockToExtents() 52 extents->push_back(new_extent); in AppendBlockToExtents() 56 google::protobuf::RepeatedPtrField<Extent>* extents, in ExtendExtents() argument 60 ExtentsToVector(*extents, &extents_vector); in ExtendExtents() 66 extents->Clear(); in ExtendExtents() 67 StoreExtents(extents_vector, extents); in ExtendExtents() 71 void StoreExtents(const vector<Extent>& extents, in StoreExtents() argument 73 for (const Extent& extent : extents) { in StoreExtents() [all …]
|
D | ext2_filesystem_unittest.cc | 53 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { in ExpectBlocksInRange() argument 54 for (const Extent& extent : extents) { in ExpectBlocksInRange() 91 ExpectBlocksInRange(file.extents, fs->GetBlockCount()); in TEST_F() 94 EXPECT_FALSE(map_files["<free-space>"].extents.empty()); in TEST_F() 121 ExpectBlocksInRange(file.extents, fs->GetBlockCount()); in TEST_F() 159 EXPECT_TRUE(map_files["/link-short_symlink"].extents.empty()); in TEST_F() 161 utils::BlocksInExtents(map_files["/link-long_symlink"].extents)); in TEST_F() 164 EXPECT_EQ(map_files["/link-hard-regular-16k"].extents, in TEST_F() 165 map_files["/regular-16k"].extents); in TEST_F() 166 EXPECT_FALSE(map_files["/regular-16k"].extents.empty()); in TEST_F() [all …]
|
D | boot_img_filesystem_unittest.cc | 82 EXPECT_EQ(1u, files[0].extents.size()); in TEST_F() 83 EXPECT_EQ(1u, files[0].extents[0].start_block()); in TEST_F() 84 EXPECT_EQ(1u, files[0].extents[0].num_blocks()); in TEST_F() 88 EXPECT_EQ(1u, files[1].extents.size()); in TEST_F() 89 EXPECT_EQ(2u, files[1].extents[0].start_block()); in TEST_F() 90 EXPECT_EQ(2u, files[1].extents[0].num_blocks()); in TEST_F() 107 EXPECT_EQ(1u, files[0].extents.size()); in TEST_F() 108 EXPECT_EQ(1u, files[0].extents[0].start_block()); in TEST_F() 109 EXPECT_EQ(1u, files[0].extents[0].num_blocks()); in TEST_F() 113 EXPECT_EQ(1u, files[1].extents.size()); in TEST_F() [all …]
|
D | extent_utils.h | 45 void AppendBlockToExtents(std::vector<Extent>* extents, uint64_t block); 50 std::vector<uint64_t> ExpandExtents(const T& extents) { in ExpandExtents() argument 52 for (const auto& extent : extents) { in ExpandExtents() 67 void StoreExtents(const std::vector<Extent>& extents, 71 void ExtentsToVector(const google::protobuf::RepeatedPtrField<Extent>& extents, 75 std::string ExtentsToString(const std::vector<Extent>& extents); 77 const google::protobuf::RepeatedPtrField<Extent>& extents); 82 google::protobuf::RepeatedPtrField<Extent>* extents, 88 void NormalizeExtents(std::vector<Extent>* extents); 94 std::vector<Extent> ExtentsSublist(const std::vector<Extent>& extents, [all …]
|
D | squashfs_filesystem_unittest.cc | 54 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { in ExpectBlocksInRange() argument 55 for (const Extent& extent : extents) { in ExpectBlocksInRange() 87 ExpectBlocksInRange(file.extents, fs->GetBlockCount()); in CheckSquashfs() 95 return a.extents[0].start_block() < in CheckSquashfs() 96 b.extents[0].start_block(); in CheckSquashfs() 102 return a.extents[0].start_block() + a.extents[0].num_blocks() > in CheckSquashfs() 103 b.extents[0].start_block(); in CheckSquashfs() 127 file.extents.emplace_back(); in TEST_F() 128 file.extents[0].set_start_block(0); in TEST_F() 129 file.extents[0].set_num_blocks(1); in TEST_F() [all …]
|
D | deflate_utils_unittest.cc | 125 vector<Extent> extents = { in TEST() local 140 out_deflates = FindDeflates(extents, in_deflates); in TEST() 145 vector<Extent> extents = {}; in TEST() local 149 out_deflates = FindDeflates(extents, in_deflates); in TEST() 152 extents = {}; in TEST() 154 out_deflates = FindDeflates(extents, in_deflates); in TEST() 159 vector<Extent> extents = { in TEST() local 166 ASSERT_TRUE(CompactDeflates(extents, in_deflates, &out_deflates)); in TEST() 171 vector<Extent> extents = {}; in TEST() local 175 EXPECT_FALSE(CompactDeflates(extents, in_deflates, &out_deflates)); in TEST() [all …]
|
D | deflate_utils.cc | 55 const vector<Extent>& extents, in CopyExtentsToFile() argument 58 brillo::Blob data(utils::BlocksInExtents(extents) * block_size); in CopyExtentsToFile() 60 utils::ReadExtents(in_path, extents, &data, data.size(), block_size)); in CopyExtentsToFile() 70 utils::BlocksInExtents(file.extents) >= in IsSquashfsImage() 75 file.extents[0].start_block() * kBlockSize, in IsSquashfsImage() 101 ShiftExtentsOverExtents(file.extents, &in_file.extents)); in RealignSplittedFiles() 103 ShiftBitExtentsOverExtents(file.extents, &in_file.deflates)); in RealignSplittedFiles() 106 num_blocks += utils::BlocksInExtents(in_file.extents); in RealignSplittedFiles() 110 TEST_AND_RETURN_FALSE(utils::BlocksInExtents(file.extents) == num_blocks); in RealignSplittedFiles() 231 vector<BitExtent> FindDeflates(const vector<Extent>& extents, in FindDeflates() argument [all …]
|
D | mapfile_filesystem_unittest.cc | 47 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { in ExpectBlocksInRange() argument 48 for (const Extent& extent : extents) { in ExpectBlocksInRange() 94 ExpectBlocksInRange(file.extents, fs->GetBlockCount()); in TEST_F() 97 EXPECT_EQ(map_files["/fileA"].extents, in TEST_F() 99 EXPECT_EQ(map_files["/fileB"].extents, in TEST_F() 102 map_files["/fileC"].extents, in TEST_F() 105 EXPECT_EQ(map_files["/file with spaces"].extents, in TEST_F() 107 EXPECT_EQ(map_files["/1234"].extents, (vector<Extent>{ExtentForRange(7, 1)})); in TEST_F()
|
D | fake_filesystem.cc | 40 const std::vector<Extent>& extents) { in AddFile() argument 43 file.extents = extents; in AddFile() 44 for (const Extent& extent : extents) { in AddFile()
|
D | squashfs_filesystem.cc | 145 file.extents = {ExtentForBytes(kBlockSize, start, cur_offset - start)}; in Init() 153 return a.extents[0].start_block() < b.extents[0].start_block(); in Init() 162 auto first_begin = first->extents[0].start_block(); in Init() 163 auto first_end = first_begin + first->extents[0].num_blocks(); in Init() 164 auto second_begin = second->extents[0].start_block(); in Init() 165 auto second_end = second_begin + second->extents[0].num_blocks(); in Init() 178 first->extents[0].set_num_blocks(second_begin - first_begin); in Init() 190 file_extents.AddExtents(file.extents); in Init() 201 file.extents = {metadata_extents[i]}; in Init() 207 return a.extents[0].start_block() < b.extents[0].start_block(); in Init() [all …]
|
D | mapfile_filesystem.cc | 94 mapped_file.extents = {}; in GetFiles() 102 mapped_file.extents.push_back(ExtentForRange(block_start, 1)); in GetFiles() 120 mapped_file.extents.push_back( in GetFiles() 131 std::reverse(mapped_file.extents.begin(), mapped_file.extents.end()); in GetFiles()
|
/system/update_engine/payload_consumer/ |
D | extent_reader_unittest.cc | 64 void ReadExtents(vector<Extent> extents, brillo::Blob* blob) { in ReadExtents() argument 66 for (const auto& extent : extents) { in ReadExtents() 80 vector<Extent> extents = {ExtentForRange(1, 1)}; in TEST_F() local 82 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize)); in TEST_F() 84 brillo::Blob blob1(utils::BlocksInExtents(extents) * kBlockSize); in TEST_F() 87 ReadExtents(extents, &blob2); in TEST_F() 92 vector<Extent> extents = {ExtentForRange(1, 0)}; in TEST_F() local 94 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize)); in TEST_F() 111 vector<Extent> extents = {ExtentForRange(1, 1)}; in TEST_F() local 113 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize)); in TEST_F() [all …]
|
D | file_descriptor_utils_unittest.cc | 91 auto extents = CreateExtentList({{0, 5}}); in TEST_F() local 95 source_, extents, target_, extents, 4, nullptr)); in TEST_F() 113 auto extents = CreateExtentList({{0, 5}}); in TEST_F() local 116 source_, extents, target_, extents, 4, nullptr)); in TEST_F() 170 auto extents = CreateExtentList({{0, 5}}); in TEST_F() local 173 EXPECT_FALSE(fd_utils::ReadAndHashExtents(source_, extents, 4, &hash_out)); in TEST_F() 178 auto extents = CreateExtentList({{0, 5}}); in TEST_F() local 179 EXPECT_TRUE(fd_utils::ReadAndHashExtents(source_, extents, 4, nullptr)); in TEST_F() 185 auto extents = CreateExtentList({{1, 1}, {4, 1}, {2, 2}, {0, 1}}); in TEST_F() local 187 EXPECT_TRUE(fd_utils::ReadAndHashExtents(source_, extents, 4, &hash_out)); in TEST_F()
|
D | block_extent_writer_unittest.cc | 58 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local 59 *extents.Add() = ExtentForRange(0, 1); in TEST_F() 60 *extents.Add() = ExtentForRange(2, 1); in TEST_F() 61 *extents.Add() = ExtentForRange(4, 1); in TEST_F() 65 *extents.Add() = ExtentForRange(10, BLOCKS_PER_BUFFER * 2); in TEST_F() 67 ASSERT_TRUE(writer.Init(extents, kBlockSize)); in TEST_F() 98 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local 101 *extents.Add() = ExtentForRange(10, BLOCKS_PER_BUFFER * 5); in TEST_F() 103 ASSERT_TRUE(writer.Init(extents, kBlockSize)); in TEST_F() 135 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local [all …]
|
D | snapshot_extent_writer_unittest.cc | 131 void AddExtent(google::protobuf::RepeatedPtrField<Extent>* extents, in AddExtent() argument 134 auto&& extent = extents->Add(); in AddExtent() 140 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local 141 AddExtent(&extents, 123, 1); in TEST_F() 142 writer_.Init(extents, kBlockSize); in TEST_F() 162 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local 163 AddExtent(&extents, 123, 1); in TEST_F() 164 AddExtent(&extents, 125, 1); in TEST_F() 165 writer_.Init(extents, kBlockSize); in TEST_F() 185 google::protobuf::RepeatedPtrField<Extent> extents; in TEST_F() local [all …]
|
D | extent_writer_unittest.cc | 66 vector<Extent> extents = {ExtentForRange(1, 1)}; in TEST_F() local 69 EXPECT_TRUE(direct_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in TEST_F() 85 vector<Extent> extents = {ExtentForRange(1, 1)}; in TEST_F() local 87 EXPECT_TRUE(direct_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in TEST_F() 105 vector<Extent> extents = { in WriteAlignedExtents() local 111 EXPECT_TRUE(direct_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in WriteAlignedExtents() 141 vector<Extent> extents = {ExtentForRange(1, 1), in TEST_F() local 151 EXPECT_TRUE(direct_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in TEST_F()
|
D | bzip_extent_writer_unittest.cc | 52 vector<Extent> extents = {ExtentForRange(0, 1)}; in TEST_F() local 64 EXPECT_TRUE(bzip_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in TEST_F() 93 vector<Extent> extents = {ExtentForBytes(kBlockSize, 0, kDecompressedLength)}; in TEST_F() local 96 EXPECT_TRUE(bzip_writer.Init({extents.begin(), extents.end()}, kBlockSize)); in TEST_F()
|
D | install_operation_executor_unittest.cc | 272 std::vector<Extent> extents; in TEST_F() local 273 extents.emplace_back(ExtentForRange(10, 3)); in TEST_F() 274 extents.emplace_back(ExtentForRange(20, 2)); in TEST_F() 275 extents.emplace_back(ExtentForRange(30, 1)); in TEST_F() 276 extents.emplace_back(ExtentForRange(40, 4)); in TEST_F() 278 ASSERT_EQ(GetNthBlock(extents, 0), 10U); in TEST_F() 279 ASSERT_EQ(GetNthBlock(extents, 2), 12U); in TEST_F() 280 ASSERT_EQ(GetNthBlock(extents, 3), 20U); in TEST_F() 281 ASSERT_EQ(GetNthBlock(extents, 4), 21U); in TEST_F() 282 ASSERT_EQ(GetNthBlock(extents, 5), 30U); in TEST_F() [all …]
|
D | extent_writer.h | 40 virtual bool Init(const google::protobuf::RepeatedPtrField<Extent>& extents, 55 bool Init(const google::protobuf::RepeatedPtrField<Extent>& extents, in Init() argument 58 extents_ = extents; in Init()
|
D | extent_map_unittest.cc | 153 const auto extents = map_.GetIntersectingExtents(ExtentForRange(0, 20)); in TEST_F() local 154 ASSERT_GT(extents.size(), 0UL); in TEST_F() 155 ASSERT_EQ(extents.size(), 2UL) in TEST_F() 156 << "Expecting unmerged extents [5-9] and [10-14], actual: " << extents; in TEST_F() 157 ASSERT_EQ(extents[0], ExtentForRange(5, 5)); in TEST_F() 158 ASSERT_EQ(extents[1], ExtentForRange(10, 5)); in TEST_F()
|
/system/core/fs_mgr/liblp/ |
D | super_layout_builder_test.cpp | 52 auto extents = tool.GetImageLayout(); in TEST() local 53 ASSERT_EQ(extents.size(), 12); in TEST() 54 EXPECT_EQ(extents[0], SuperImageExtent(0, 4096, SuperImageExtent::Type::ZERO)); in TEST() 55 EXPECT_EQ(extents[1], SuperImageExtent(4096, geometry_blob)); in TEST() 56 EXPECT_EQ(extents[2], SuperImageExtent(8192, geometry_blob)); in TEST() 57 EXPECT_EQ(extents[3], SuperImageExtent(12288, metadata_blob)); in TEST() 58 EXPECT_EQ(extents[4], SuperImageExtent(16384, 4096, SuperImageExtent::Type::DONTCARE)); in TEST() 59 EXPECT_EQ(extents[5], SuperImageExtent(20480, metadata_blob)); in TEST() 60 EXPECT_EQ(extents[6], SuperImageExtent(24576, 4096, SuperImageExtent::Type::DONTCARE)); in TEST() 61 EXPECT_EQ(extents[7], SuperImageExtent(28672, metadata_blob)); in TEST() [all …]
|
D | super_layout_builder.cpp | 59 if (!metadata.extents.empty()) { in Open() 88 static bool AddGapExtents(std::vector<SuperImageExtent>* extents, SuperImageExtent::Type gap_type) { in AddGapExtents() argument 89 std::vector<SuperImageExtent> old = std::move(*extents); in AddGapExtents() 92 *extents = {}; in AddGapExtents() 104 extents->emplace_back(current_offset, gap_size, gap_type); in AddGapExtents() 108 extents->emplace_back(extent); in AddGapExtents() 120 std::vector<SuperImageExtent> extents; in GetImageLayout() local 126 extents.emplace_back(0, GetPrimaryGeometryOffset(), SuperImageExtent::Type::ZERO); in GetImageLayout() 127 extents.emplace_back(GetPrimaryGeometryOffset(), blob); in GetImageLayout() 128 extents.emplace_back(GetBackupGeometryOffset(), blob); in GetImageLayout() [all …]
|
D | builder_test.cpp | 72 ASSERT_EQ(system->extents().size(), 1); in TEST_F() 74 LinearExtent* extent = system->extents()[0]->AsLinearExtent(); in TEST_F() 86 EXPECT_EQ(system->extents().size(), 1); in TEST_F() 87 EXPECT_EQ(system->extents()[0]->num_sectors(), 65536 / LP_SECTOR_SIZE); in TEST_F() 91 EXPECT_EQ(system->extents().size(), 0); in TEST_F() 95 EXPECT_EQ(system->extents().size(), 1); in TEST_F() 96 EXPECT_EQ(system->extents()[0]->num_sectors(), 131072 / LP_SECTOR_SIZE); in TEST_F() 100 EXPECT_EQ(system->extents().size(), 1); in TEST_F() 101 EXPECT_EQ(system->extents()[0]->num_sectors(), (1024 * 256) / LP_SECTOR_SIZE); in TEST_F() 106 EXPECT_EQ(system->extents().size(), 1); in TEST_F() [all …]
|
D | builder.cpp | 55 out->extents.emplace_back( in AddTo() 90 out->extents.emplace_back(LpMetadataExtent{num_sectors_, LP_TARGET_TYPE_ZERO, 0, 0}); in AddTo() 266 metadata->extents.clear(); in UpdateMetadataForOtherSuper() 311 header_.extents.entry_size = sizeof(LpMetadataExtent); in MetadataBuilder() 348 const LpMetadataExtent& extent = metadata.extents[source.first_extent_index + i]; in ImportExtents() 585 void MetadataBuilder::ExtentsToFreeList(const std::vector<Interval>& extents, in ExtentsToFreeList() argument 589 for (size_t i = 1; i < extents.size(); i++) { in ExtentsToFreeList() 590 const Interval& previous = extents[i - 1]; in ExtentsToFreeList() 591 const Interval& current = extents[i]; in ExtentsToFreeList() 619 for (const auto& extent : partition->extents()) { in GetFreeRegions() [all …]
|