blob: 073a15678f2df488d033397f5e32f2fbc62ebb58 [file] [log] [blame]
Fabien Sanglard0f29f542020-10-22 17:58:12 -07001#include "gmock/gmock.h"
2#include "gtest/gtest.h"
3
4#include "ZipAlign.h"
5
6#include <stdio.h>
Fabien Sanglard6dfc6fb2020-10-22 17:58:12 -07007#include <string>
8
9#include <android-base/file.h>
Fabien Sanglard0f29f542020-10-22 17:58:12 -070010
11using namespace android;
12
Fabien Sanglard6dfc6fb2020-10-22 17:58:12 -070013static std::string GetTestPath(const std::string& filename) {
14 static std::string test_data_dir = android::base::GetExecutableDirectory() + "/tests/data/";
15 return test_data_dir + filename;
16}
17
Fabien Sanglard0f29f542020-10-22 17:58:12 -070018TEST(Align, Unaligned) {
Fabien Sanglard6dfc6fb2020-10-22 17:58:12 -070019 const std::string src = GetTestPath("unaligned.zip");
20 const std::string dst = GetTestPath("unaligned_out.zip");
21
22 int result = process(src.c_str(), dst.c_str(), 4, true, false, 4096);
Fabien Sanglard0f29f542020-10-22 17:58:12 -070023 ASSERT_EQ(0, result);
24}