summaryrefslogtreecommitdiffstats
path: root/tests/component/imgdiff_test.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-05 08:25:35 +0100
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-05 08:25:35 +0100
commitc1a764754f2d5cda88f74c82e3433e60277158ec (patch)
tree404792948fef70fb486d4bf8a28635c26355cc32 /tests/component/imgdiff_test.cpp
parentSnap for 4429796 from efb6a0b7a6d6e68d0213e628b3fa6f31c6b13007 to pi-release (diff)
parentMerge "Clean up fuse_sideload and add a testcase." am: 73dca3e983 am: 6d61e2123b (diff)
downloadandroid_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar.gz
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar.bz2
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar.lz
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar.xz
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.tar.zst
android_bootable_recovery-c1a764754f2d5cda88f74c82e3433e60277158ec.zip
Diffstat (limited to 'tests/component/imgdiff_test.cpp')
-rw-r--r--tests/component/imgdiff_test.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/component/imgdiff_test.cpp b/tests/component/imgdiff_test.cpp
index 6de804e06..728b6cc76 100644
--- a/tests/component/imgdiff_test.cpp
+++ b/tests/component/imgdiff_test.cpp
@@ -657,19 +657,23 @@ static void construct_deflate_entry(const std::vector<std::tuple<std::string, si
}
}
-// Look for the generated source and patch pieces in the debug_dir and generate the target on
-// each pair. Concatenate the split target and match against the orignal one.
+// Look for the source and patch pieces in debug_dir. Generate a target piece from each pair.
+// Concatenate all the target pieces and match against the orignal one. Used pieces in debug_dir
+// will be cleaned up.
static void GenerateAndCheckSplitTarget(const std::string& debug_dir, size_t count,
const std::string& tgt) {
std::string patched;
for (size_t i = 0; i < count; i++) {
std::string split_src_path = android::base::StringPrintf("%s/src-%zu", debug_dir.c_str(), i);
- std::string split_patch_path = android::base::StringPrintf("%s/patch-%zu", debug_dir.c_str(), i);
-
std::string split_src;
- std::string split_patch;
ASSERT_TRUE(android::base::ReadFileToString(split_src_path, &split_src));
+ ASSERT_EQ(0, unlink(split_src_path.c_str()));
+
+ std::string split_patch_path =
+ android::base::StringPrintf("%s/patch-%zu", debug_dir.c_str(), i);
+ std::string split_patch;
ASSERT_TRUE(android::base::ReadFileToString(split_patch_path, &split_patch));
+ ASSERT_EQ(0, unlink(split_patch_path.c_str()));
std::string split_tgt;
GenerateTarget(split_src, split_patch, &split_tgt);