aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTianjie Xu2017-09-17 16:42:23 -0500
committerandroid-build-merger2017-09-17 16:42:23 -0500
commit2cb1fb45c0793bee23fe49ae0a89748787c769c8 (patch)
treef2985b603220017ddb1bb52d12310823d357c6c5 /tests
parentad878d5494c30c8ce3f50977900a89840f73e176 (diff)
parentca5a0713073b3e93dc4a037c8ab75cb22b22babc (diff)
downloadplatform-bootable-recovery-2cb1fb45c0793bee23fe49ae0a89748787c769c8.tar.gz
platform-bootable-recovery-2cb1fb45c0793bee23fe49ae0a89748787c769c8.tar.xz
platform-bootable-recovery-2cb1fb45c0793bee23fe49ae0a89748787c769c8.zip
Merge "Fix the dangling pointer when setting up arguments of imgdiff"
am: ca5a071307 Change-Id: I9411f0bce8d96c598db365d0257d4c9893e24104
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 3163a57c..73516050 100644
--- a/tests/component/imgdiff_test.cpp
+++ b/tests/component/imgdiff_test.cpp
@@ -779,9 +779,10 @@ TEST(ImgdiffTest, zip_mode_store_large_apk) {
779 // Compute patch. 779 // Compute patch.
780 TemporaryFile patch_file; 780 TemporaryFile patch_file;
781 TemporaryDir debug_dir; 781 TemporaryDir debug_dir;
782 std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
782 std::vector<const char*> args = { 783 std::vector<const char*> args = {
783 "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf( 784 "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
784 "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path, 785 patch_file.path,
785 }; 786 };
786 ASSERT_EQ(0, imgdiff(args.size(), args.data())); 787 ASSERT_EQ(0, imgdiff(args.size(), args.data()));
787 788
@@ -901,9 +902,10 @@ TEST(ImgdiffTest, zip_mode_no_match_source) {
901 // Compute patch. 902 // Compute patch.
902 TemporaryFile patch_file; 903 TemporaryFile patch_file;
903 TemporaryDir debug_dir; 904 TemporaryDir debug_dir;
905 std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
904 std::vector<const char*> args = { 906 std::vector<const char*> args = {
905 "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf( 907 "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
906 "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path, 908 patch_file.path,
907 }; 909 };
908 ASSERT_EQ(0, imgdiff(args.size(), args.data())); 910 ASSERT_EQ(0, imgdiff(args.size(), args.data()));
909 911
@@ -940,9 +942,10 @@ TEST(ImgdiffTest, zip_mode_large_enough_limit) {
940 // Compute patch with a limit of 20 blocks. 942 // Compute patch with a limit of 20 blocks.
941 TemporaryFile patch_file; 943 TemporaryFile patch_file;
942 TemporaryDir debug_dir; 944 TemporaryDir debug_dir;
945 std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
943 std::vector<const char*> args = { 946 std::vector<const char*> args = {
944 "imgdiff", "-z", "--block-limit=20", android::base::StringPrintf( 947 "imgdiff", "-z", "--block-limit=20", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
945 "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path, 948 patch_file.path,
946 }; 949 };
947 ASSERT_EQ(0, imgdiff(args.size(), args.data())); 950 ASSERT_EQ(0, imgdiff(args.size(), args.data()));
948 951