Fix unit tests, and extend for other architectures
On unpacking, reinstate any p_align values that packing reduced to
page size. Ensures a round-trip pack and unpack is bit-equivalent
to the original input.
https://android-review.googlesource.com/#/c/148492/
Extend unit tests to include ia32, x64, and mips32.
Recreate test data for arm32 and arm64. Generate new test data for
ia32, x64, and mips32.
Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ifbca8e206ef447297ba4f19272b813702be27a35
diff --git a/tools/relocation_packer/src/elf_file_unittest.cc b/tools/relocation_packer/src/elf_file_unittest.cc
index 32f7968..d5c8918 100644
--- a/tools/relocation_packer/src/elf_file_unittest.cc
+++ b/tools/relocation_packer/src/elf_file_unittest.cc
@@ -183,6 +183,18 @@
RunPackRelocationsTestFor("arm64");
}
+TEST(ElfFile, PackRelocationsMips32) {
+ RunPackRelocationsTestFor("mips32");
+}
+
+TEST(ElfFile, PackRelocationsIa32) {
+ RunPackRelocationsTestFor("ia32");
+}
+
+TEST(ElfFile, PackRelocationsX64) {
+ RunPackRelocationsTestFor("x64");
+}
+
TEST(ElfFile, UnpackRelocationsArm32) {
RunUnpackRelocationsTestFor("arm32");
}
@@ -191,4 +203,16 @@
RunUnpackRelocationsTestFor("arm64");
}
+TEST(ElfFile, UnpackRelocationsMips32) {
+ RunUnpackRelocationsTestFor("mips32");
+}
+
+TEST(ElfFile, UnpackRelocationsIa32) {
+ RunUnpackRelocationsTestFor("ia32");
+}
+
+TEST(ElfFile, UnpackRelocationsX64) {
+ RunUnpackRelocationsTestFor("x64");
+}
+
} // namespace relocation_packer