Lines Matching refs:patch
38 // Sanity check for the given imgdiff patch header.
39 static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw,
41 const size_t size = patch.size();
42 const char* data = patch.data();
75 FAIL() << "Invalid patch type: " << type;
84 static void GenerateTarget(const std::string& src, const std::string& patch, std::string* patched) {
87 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(),
94 static void verify_patched_image(const std::string& src, const std::string& patch,
97 GenerateTarget(src, patch, &patched);
134 std::string patch;
135 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
141 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
146 verify_patched_image(src, patch, tgt);
171 // Compute patch.
183 std::string patch;
184 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
190 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
195 verify_patched_image(src, patch, tgt);
225 // Compute patch.
237 std::string patch;
238 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
244 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
249 verify_patched_image(src, patch, tgt);
273 // Compute patch.
285 std::string patch;
286 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
288 verify_patched_image(src, patch, tgt);
321 // Compute patch.
333 std::string patch;
334 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
340 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
345 verify_patched_image(src, patch, tgt);
372 std::string patch;
373 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
379 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
384 verify_patched_image(src, patch, tgt);
415 std::string patch;
416 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
417 verify_patched_image(src, patch, tgt);
479 std::string patch;
480 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
486 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
491 verify_patched_image(src, patch, tgt);
516 std::string patch;
517 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
523 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
528 verify_patched_image(src, patch, tgt);
552 std::string patch;
553 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
559 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
564 verify_patched_image(src, patch, tgt);
588 std::string patch;
589 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
595 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
600 verify_patched_image(src, patch, tgt);
627 std::string patch;
628 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
634 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate);
639 verify_patched_image(src, patch, tgt);
670 std::string patch;
671 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch));
672 verify_patched_image(src, patch, tgt);
674 // Corrupt the end of the patch and expect the ApplyImagePatch to fail.
675 patch.insert(patch.end() - 10, 10, '0');
677 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(),
702 // Look for the source and patch pieces in debug_dir. Generate a target piece from each pair.
715 android::base::StringPrintf("%s/patch-%zu", debug_dir.c_str(), i);
828 // Compute patch.
843 // Expect 4 pieces of patch. (Roughly 3'a',3'b'; 8'c'; 10'd'; 2'd'3'e')
894 // Compute patch.
902 // Expect 5 pieces of patch. ["a","b"; "c"; "d-0"; "d-1"; "e"]
921 std::string path = android::base::StringPrintf("%s/patch-%zu", debug_dir.path, i);
954 // Compute patch.
969 // Expect 1 pieces of patch due to no matching source entry.
996 // Compute patch with a limit of 20 blocks.
1011 // Expect 1 piece of patch since limit is larger than the zip file size.
1041 // Compute patch.
1095 // Compute patch.