Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 1 | #include "gmock/gmock.h" |
| 2 | #include "gtest/gtest.h" |
| 3 | |
| 4 | #include "ZipAlign.h" |
| 5 | |
| 6 | #include <stdio.h> |
Fabien Sanglard | 6dfc6fb | 2020-10-22 17:58:12 -0700 | [diff] [blame^] | 7 | #include <string> |
| 8 | |
| 9 | #include <android-base/file.h> |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 10 | |
| 11 | using namespace android; |
| 12 | |
Fabien Sanglard | 6dfc6fb | 2020-10-22 17:58:12 -0700 | [diff] [blame^] | 13 | static 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 Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 18 | TEST(Align, Unaligned) { |
Fabien Sanglard | 6dfc6fb | 2020-10-22 17:58:12 -0700 | [diff] [blame^] | 19 | 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 Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 23 | ASSERT_EQ(0, result); |
| 24 | } |