Refactor zipalign to allow unit tests

Test: Self-tested
Bug: NA
Change-Id: I322b78c5e18082f7abf7427cdc62dbabcb18b4a0
diff --git a/tools/zipalign/tests/src/align_test.cpp b/tools/zipalign/tests/src/align_test.cpp
new file mode 100644
index 0000000..b8f2e15
--- /dev/null
+++ b/tools/zipalign/tests/src/align_test.cpp
@@ -0,0 +1,15 @@
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include "ZipAlign.h"
+
+#include <stdio.h>
+
+using namespace android;
+
+TEST(Align, Unaligned) {
+  const char* src = "tests/data/unaligned.zip";
+  const char* dst = "tests/data/unaligned_out.zip";
+  int result = process(src, dst, 4, true, false, 4096);
+  ASSERT_EQ(0, result);
+}