Refactor zipalign to allow unit tests

Test: Self-tested
Bug: NA
Change-Id: If5e42735853e1508fbeb9fb420a9a9f129c2218f
This commit is contained in:
Fabien Sanglard
2020-10-22 17:58:12 -07:00
parent baade4a3c4
commit d4f71a97bd
8 changed files with 246 additions and 121 deletions

View File

@@ -35,7 +35,7 @@
#include <assert.h>
#include <inttypes.h>
using namespace android;
namespace android {
/*
* Some environments require the "b", some choke on it.
@@ -134,7 +134,7 @@ status_t ZipFile::open(const char* zipFileName, int flags)
/*
* Return the Nth entry in the archive.
*/
android::ZipEntry* ZipFile::getEntryByIndex(int idx) const
ZipEntry* ZipFile::getEntryByIndex(int idx) const
{
if (idx < 0 || idx >= (int) mEntries.size())
return NULL;
@@ -145,7 +145,7 @@ android::ZipEntry* ZipFile::getEntryByIndex(int idx) const
/*
* Find an entry by name.
*/
android::ZipEntry* ZipFile::getEntryByName(const char* fileName) const
ZipEntry* ZipFile::getEntryByName(const char* fileName) const
{
/*
* Do a stupid linear string-compare search.
@@ -1397,3 +1397,4 @@ void ZipFile::EndOfCentralDir::dump(void) const
mCentralDirSize, mCentralDirOffset, mCommentLen);
}
} // namespace android