Make tests use APKs instead of exploded APKs

Tests would expect parts of the APK to be unzipped and
maintained. Instead, we now decompress the required files
from the test APKs on test setup. This simplifies
test maintenance substantially.

Test: make libandroidfw_tests && libandroidfw_tests --testdata=frameworks/base/libs/androidfw/tests/data
Change-Id: I3d2100af22df913e02401dedcf9842cdb32b2a3b
diff --git a/libs/androidfw/tests/AttributeFinder_test.cpp b/libs/androidfw/tests/AttributeFinder_test.cpp
index d9ed48e..7264b81 100644
--- a/libs/androidfw/tests/AttributeFinder_test.cpp
+++ b/libs/androidfw/tests/AttributeFinder_test.cpp
@@ -14,16 +14,18 @@
  * limitations under the License.
  */
 
-#include "../AttributeFinder.h"
+#include "androidfw/AttributeFinder.h"
 
-#include <android-base/macros.h>
-#include <gtest/gtest.h>
+#include "android-base/macros.h"
+#include "gtest/gtest.h"
 
-using android::BackTrackingAttributeFinder;
+namespace android {
 
-class MockAttributeFinder : public BackTrackingAttributeFinder<MockAttributeFinder, int> {
+class MockAttributeFinder
+    : public BackTrackingAttributeFinder<MockAttributeFinder, int> {
  public:
-  MockAttributeFinder(const uint32_t* attrs, int len) : BackTrackingAttributeFinder(0, len) {
+  MockAttributeFinder(const uint32_t* attrs, int len)
+      : BackTrackingAttributeFinder(0, len) {
     attrs_ = new uint32_t[len];
     memcpy(attrs_, attrs, sizeof(*attrs) * len);
   }
@@ -36,13 +38,16 @@
   uint32_t* attrs_;
 };
 
-static const uint32_t kSortedAttributes[] = {0x01010000, 0x01010001, 0x01010002, 0x01010004,
-                                             0x02010001, 0x02010010, 0x7f010001};
+static const uint32_t kSortedAttributes[] = {0x01010000, 0x01010001, 0x01010002,
+                                             0x01010004, 0x02010001, 0x02010010,
+                                             0x7f010001};
 
 static const uint32_t kPackageUnsortedAttributes[] = {
-    0x02010001, 0x02010010, 0x01010000, 0x01010001, 0x01010002, 0x01010004, 0x7f010001};
+    0x02010001, 0x02010010, 0x01010000, 0x01010001,
+    0x01010002, 0x01010004, 0x7f010001};
 
-static const uint32_t kSinglePackageAttributes[] = {0x7f010007, 0x7f01000a, 0x7f01000d, 0x00000000};
+static const uint32_t kSinglePackageAttributes[] = {0x7f010007, 0x7f01000a,
+                                                    0x7f01000d, 0x00000000};
 
 TEST(AttributeFinderTest, IteratesSequentially) {
   const int end = arraysize(kSortedAttributes);
@@ -116,3 +121,5 @@
   EXPECT_EQ(end, finder.Find(0x010100fa));
   EXPECT_EQ(0, finder.Find(0x7f010007));
 }
+
+}  // namespace android