Add lz4 decompress/compress routines
During OTA generation, we decompress blobs on disk using lz4, and
perform diffing on the decompressed blobs. This is known to help OTA
size a lot. This CL adds decompression routines, following CLs will
start to actually call these routines.
Test: th
Bug: 206729162
Change-Id: Ifee87220e95740cb73a68ef84935c1cbb6a78666
diff --git a/aosp/update_attempter_android_unittest.cc b/aosp/update_attempter_android_unittest.cc
index 81a3230..d67bf01 100644
--- a/aosp/update_attempter_android_unittest.cc
+++ b/aosp/update_attempter_android_unittest.cc
@@ -63,6 +63,11 @@
namespace chromeos_update_engine {
+// Compare the value of builtin array for download source parameter.
+MATCHER_P(DownloadSourceMatcher, source_array, "") {
+ return std::equal(source_array, source_array + kNumDownloadSources, arg);
+}
+
class UpdateAttempterAndroidTest : public ::testing::Test {
protected:
UpdateAttempterAndroidTest() = default;
@@ -97,6 +102,8 @@
testing::NiceMock<MockMetricsReporter>* metrics_reporter_;
};
+namespace {
+
TEST_F(UpdateAttempterAndroidTest, UpdatePrefsSameBuildVersionOnInit) {
std::string build_version =
android::base::GetProperty("ro.build.version.incremental", "");
@@ -208,18 +215,10 @@
int64_t total_bytes[kNumDownloadSources] = {};
total_bytes[kDownloadSourceHttpsServer] = 90;
- EXPECT_CALL(*metrics_reporter_,
- ReportSuccessfulUpdateMetrics(
- _,
- _,
- _,
- 50,
- test_utils::DownloadSourceMatcher(total_bytes),
- 80,
- _,
- _,
- _,
- _))
+ EXPECT_CALL(
+ *metrics_reporter_,
+ ReportSuccessfulUpdateMetrics(
+ _, _, _, 50, DownloadSourceMatcher(total_bytes), 80, _, _, _, _))
.Times(1);
// Adds a payload of 50 bytes to the InstallPlan.
@@ -249,4 +248,6 @@
0, metrics_utils::GetPersistedValue(kPrefsTotalBytesDownloaded, &prefs_));
}
+} // namespace
+
} // namespace chromeos_update_engine