Move sysMapFile and sysReleaseMap into MemMapping class.

Test: recovery_component_test
Test: recovery_unit_test
Test: Apply an OTA on angler.
Change-Id: I7170f03e4ce1fe06184ca1d7bcce0a695f33ac4d
This commit is contained in:
Tao Bao
2017-04-18 23:54:29 -07:00
parent ba365180d3
commit b656a154ea
8 changed files with 113 additions and 141 deletions
+2 -3
View File
@@ -66,9 +66,9 @@ TEST(ZipTest, ExtractPackageRecursive) {
}
TEST(ZipTest, OpenFromMemory) {
MemMapping map;
std::string zip_path = from_testdata_base("ziptest_dummy-update.zip");
ASSERT_EQ(0, sysMapFile(zip_path.c_str(), &map));
MemMapping map;
ASSERT_TRUE(map.MapFile(zip_path));
// Map an update package into memory and open the archive from there.
ZipArchiveHandle handle;
@@ -85,6 +85,5 @@ TEST(ZipTest, OpenFromMemory) {
ASSERT_EQ(0, ExtractEntryToFile(handle, &binary_entry, tmp_binary.fd));
CloseArchive(handle);
sysReleaseMap(&map);
}