From d8b67f49d7f8ae291cd4fa901b2d3767137704e7 Mon Sep 17 00:00:00 2001 From: Amin Hassani Date: Wed, 6 Dec 2017 13:47:52 -0800 Subject: update_engine: Remove the duplicate BlocksInExtents This patch removes the duplicate BlocksInExtents from extent_utils.h and fixes the remainder of the code to reflect this change. BUG=none TEST=unittests pass; Change-Id: I76f5106f75072b20cd8f41f081b2f2b07aeac9a8 Reviewed-on: https://chromium-review.googlesource.com/812009 Commit-Ready: Amin Hassani Tested-by: Amin Hassani Reviewed-by: Ben Chan Reviewed-by: Alex Deymo Reviewed-by: Sen Jiang --- payload_generator/ext2_filesystem_unittest.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'payload_generator/ext2_filesystem_unittest.cc') diff --git a/payload_generator/ext2_filesystem_unittest.cc b/payload_generator/ext2_filesystem_unittest.cc index a3c7731e..5360e6cd 100644 --- a/payload_generator/ext2_filesystem_unittest.cc +++ b/payload_generator/ext2_filesystem_unittest.cc @@ -158,7 +158,8 @@ TEST_F(Ext2FilesystemTest, ParseGeneratedImages) { // Small symlinks don't actually have data blocks. EXPECT_TRUE(map_files["/link-short_symlink"].extents.empty()); - EXPECT_EQ(1U, BlocksInExtents(map_files["/link-long_symlink"].extents)); + EXPECT_EQ(1U, + utils::BlocksInExtents(map_files["/link-long_symlink"].extents)); // Hard-links report the same list of blocks. EXPECT_EQ(map_files["/link-hard-regular-16k"].extents, @@ -168,14 +169,19 @@ TEST_F(Ext2FilesystemTest, ParseGeneratedImages) { // The number of blocks in these files doesn't depend on the // block size. EXPECT_TRUE(map_files["/empty-file"].extents.empty()); - EXPECT_EQ(1U, BlocksInExtents(map_files["/regular-small"].extents)); - EXPECT_EQ(1U, BlocksInExtents(map_files["/regular-with_net_cap"].extents)); + EXPECT_EQ(1U, utils::BlocksInExtents(map_files["/regular-small"].extents)); + EXPECT_EQ( + 1U, utils::BlocksInExtents(map_files["/regular-with_net_cap"].extents)); EXPECT_TRUE(map_files["/sparse_empty-10k"].extents.empty()); EXPECT_TRUE(map_files["/sparse_empty-2blocks"].extents.empty()); - EXPECT_EQ(1U, BlocksInExtents(map_files["/sparse-16k-last_block"].extents)); - EXPECT_EQ(1U, - BlocksInExtents(map_files["/sparse-16k-first_block"].extents)); - EXPECT_EQ(2U, BlocksInExtents(map_files["/sparse-16k-holes"].extents)); + EXPECT_EQ( + 1U, + utils::BlocksInExtents(map_files["/sparse-16k-last_block"].extents)); + EXPECT_EQ( + 1U, + utils::BlocksInExtents(map_files["/sparse-16k-first_block"].extents)); + EXPECT_EQ(2U, + utils::BlocksInExtents(map_files["/sparse-16k-holes"].extents)); } } -- cgit v1.2.3