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/Asset_test.cpp b/libs/androidfw/tests/Asset_test.cpp
index 45c8cef..5018218 100644
--- a/libs/androidfw/tests/Asset_test.cpp
+++ b/libs/androidfw/tests/Asset_test.cpp
@@ -14,24 +14,26 @@
* limitations under the License.
*/
-#include <androidfw/Asset.h>
+#include "androidfw/Asset.h"
-#include <gtest/gtest.h>
+#include "gtest/gtest.h"
-using namespace android;
+namespace android {
TEST(AssetTest, FileAssetRegistersItself) {
- const int32_t count = Asset::getGlobalCount();
- Asset* asset = new _FileAsset();
- EXPECT_EQ(count + 1, Asset::getGlobalCount());
- delete asset;
- EXPECT_EQ(count, Asset::getGlobalCount());
+ const int32_t count = Asset::getGlobalCount();
+ Asset* asset = new _FileAsset();
+ EXPECT_EQ(count + 1, Asset::getGlobalCount());
+ delete asset;
+ EXPECT_EQ(count, Asset::getGlobalCount());
}
TEST(AssetTest, CompressedAssetRegistersItself) {
- const int32_t count = Asset::getGlobalCount();
- Asset* asset = new _CompressedAsset();
- EXPECT_EQ(count + 1, Asset::getGlobalCount());
- delete asset;
- EXPECT_EQ(count, Asset::getGlobalCount());
+ const int32_t count = Asset::getGlobalCount();
+ Asset* asset = new _CompressedAsset();
+ EXPECT_EQ(count + 1, Asset::getGlobalCount());
+ delete asset;
+ EXPECT_EQ(count, Asset::getGlobalCount());
}
+
+} // nameapce android