summaryrefslogtreecommitdiff
path: root/payload_consumer/file_descriptor_utils_unittest.cc
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2018-05-22 17:24:23 -0700
committerSen Jiang <senj@google.com>2018-05-30 23:48:57 +0000
commit77ab7bdf2dcf7fd4aa982e654f359958ad7ab0c3 (patch)
tree81831f51ba58f7222c1c1a10d564ed15541a234a /payload_consumer/file_descriptor_utils_unittest.cc
parent8712e96150cd37ff776c2401b2a944c3c3b73cd3 (diff)
Recover source hash failures on other source operations.
In addition to SOURCE_COPY, now SOURCE_BSDIFF, BROTLI_BSDIFF and PUFFDIFF will also recover source hash failures using error correction data. Bug: 34284069 Test: update_engine_unittests Change-Id: I536d0675e3550aa142b77b4c8bf0a9f70a789652
Diffstat (limited to 'payload_consumer/file_descriptor_utils_unittest.cc')
-rw-r--r--payload_consumer/file_descriptor_utils_unittest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/payload_consumer/file_descriptor_utils_unittest.cc b/payload_consumer/file_descriptor_utils_unittest.cc
index 79d21846..48e610f1 100644
--- a/payload_consumer/file_descriptor_utils_unittest.cc
+++ b/payload_consumer/file_descriptor_utils_unittest.cc
@@ -175,10 +175,10 @@ TEST_F(FileDescriptorUtilsTest, ReadAndHashExtentsReadFailureTest) {
EXPECT_FALSE(fd_utils::ReadAndHashExtents(source_, extents, 4, &hash_out));
}
-// Test that if hash_out is null, then it should fail.
+// Test that if hash_out is null, it still works.
TEST_F(FileDescriptorUtilsTest, ReadAndHashExtentsWithoutHashingTest) {
auto extents = CreateExtentList({{0, 5}});
- EXPECT_FALSE(fd_utils::ReadAndHashExtents(source_, extents, 4, nullptr));
+ EXPECT_TRUE(fd_utils::ReadAndHashExtents(source_, extents, 4, nullptr));
}
// Tests that it can calculate the hash properly.