summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-09-17 23:39:09 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-09-17 23:39:09 +0200
commitca5a0713073b3e93dc4a037c8ab75cb22b22babc (patch)
tree82fec7ff36560d261e6dcdc9e1bd62922817cb7b /tests
parentMerge "Remove EXPAND/STRINGIFY macros." (diff)
parentFix the dangling pointer when setting up arguments of imgdiff (diff)
downloadandroid_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar.gz
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar.bz2
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar.lz
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar.xz
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.tar.zst
android_bootable_recovery-ca5a0713073b3e93dc4a037c8ab75cb22b22babc.zip
Diffstat (limited to 'tests')
-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()));