summaryrefslogtreecommitdiffstats
path: root/tests/component/imgdiff_test.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-18 10:05:51 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-18 10:05:51 +0200
commitc208c746db7928eaf66c2aa40f4f2aa79b2bd138 (patch)
tree37b85d39756dc72c0797cb2a0243df9477add7fc /tests/component/imgdiff_test.cpp
parentrelease-request-b06579bd-a905-4db5-ada9-c69d40f4df90-for-git_pi-release-4335309 snap-temp-L62700000102430107 (diff)
parentMerge "Fix the dangling pointer when setting up arguments of imgdiff" am: ca5a071307 am: 2cb1fb45c0 am: ed50c1817f (diff)
downloadandroid_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar.gz
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar.bz2
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar.lz
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar.xz
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.tar.zst
android_bootable_recovery-c208c746db7928eaf66c2aa40f4f2aa79b2bd138.zip
Diffstat (limited to 'tests/component/imgdiff_test.cpp')
-rw-r--r--tests/component/imgdiff_test.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/component/imgdiff_test.cpp b/tests/component/imgdiff_test.cpp
index 3163a57cf..73516050b 100644
--- a/tests/component/imgdiff_test.cpp
+++ b/tests/component/imgdiff_test.cpp
@@ -779,9 +779,10 @@ TEST(ImgdiffTest, zip_mode_store_large_apk) {
// Compute patch.
TemporaryFile patch_file;
TemporaryDir debug_dir;
+ std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
std::vector<const char*> args = {
- "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf(
- "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+ "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+ patch_file.path,
};
ASSERT_EQ(0, imgdiff(args.size(), args.data()));
@@ -901,9 +902,10 @@ TEST(ImgdiffTest, zip_mode_no_match_source) {
// Compute patch.
TemporaryFile patch_file;
TemporaryDir debug_dir;
+ std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
std::vector<const char*> args = {
- "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf(
- "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+ "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+ patch_file.path,
};
ASSERT_EQ(0, imgdiff(args.size(), args.data()));
@@ -940,9 +942,10 @@ TEST(ImgdiffTest, zip_mode_large_enough_limit) {
// Compute patch with a limit of 20 blocks.
TemporaryFile patch_file;
TemporaryDir debug_dir;
+ std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
std::vector<const char*> args = {
- "imgdiff", "-z", "--block-limit=20", android::base::StringPrintf(
- "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+ "imgdiff", "-z", "--block-limit=20", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+ patch_file.path,
};
ASSERT_EQ(0, imgdiff(args.size(), args.data()));