Run idmap2 static-checks and fix formatting issues

Bug: 130324774
Test: builds
Change-Id: I2cf9d3aa268ffe38e525fadee9d81fc6aefe19b1
diff --git a/cmds/idmap2/idmap2/Create.cpp b/cmds/idmap2/idmap2/Create.cpp
index 47617e0..bb8d927 100644
--- a/cmds/idmap2/idmap2/Create.cpp
+++ b/cmds/idmap2/idmap2/Create.cpp
@@ -16,6 +16,7 @@
 
 #include <sys/stat.h>   // umask
 #include <sys/types.h>  // umask
+
 #include <fstream>
 #include <memory>
 #include <ostream>
diff --git a/cmds/idmap2/idmap2/Lookup.cpp b/cmds/idmap2/idmap2/Lookup.cpp
index 677c6fa..b7ae9d0 100644
--- a/cmds/idmap2/idmap2/Lookup.cpp
+++ b/cmds/idmap2/idmap2/Lookup.cpp
@@ -31,15 +31,14 @@
 #include "androidfw/ResourceUtils.h"
 #include "androidfw/StringPiece.h"
 #include "androidfw/Util.h"
-#include "utils/String16.h"
-#include "utils/String8.h"
-
 #include "idmap2/CommandLineOptions.h"
 #include "idmap2/Idmap.h"
 #include "idmap2/Result.h"
 #include "idmap2/SysTrace.h"
 #include "idmap2/Xml.h"
 #include "idmap2/ZipFile.h"
+#include "utils/String16.h"
+#include "utils/String8.h"
 
 using android::ApkAssets;
 using android::ApkAssetsCookie;
diff --git a/cmds/idmap2/idmap2/Main.cpp b/cmds/idmap2/idmap2/Main.cpp
index d8867fe..8794908 100644
--- a/cmds/idmap2/idmap2/Main.cpp
+++ b/cmds/idmap2/idmap2/Main.cpp
@@ -23,12 +23,11 @@
 #include <string>
 #include <vector>
 
+#include "Commands.h"
 #include "idmap2/CommandLineOptions.h"
 #include "idmap2/Result.h"
 #include "idmap2/SysTrace.h"
 
-#include "Commands.h"
-
 using android::idmap2::CommandLineOptions;
 using android::idmap2::Result;
 using android::idmap2::Unit;
diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp
index 55b1003..f648048 100644
--- a/cmds/idmap2/idmap2/Scan.cpp
+++ b/cmds/idmap2/idmap2/Scan.cpp
@@ -15,6 +15,7 @@
  */
 
 #include <dirent.h>
+
 #include <fstream>
 #include <memory>
 #include <ostream>
@@ -24,8 +25,8 @@
 #include <utility>
 #include <vector>
 
+#include "Commands.h"
 #include "android-base/properties.h"
-
 #include "idmap2/CommandLineOptions.h"
 #include "idmap2/FileUtils.h"
 #include "idmap2/Idmap.h"
@@ -35,8 +36,6 @@
 #include "idmap2/Xml.h"
 #include "idmap2/ZipFile.h"
 
-#include "Commands.h"
-
 using android::idmap2::CommandLineOptions;
 using android::idmap2::Error;
 using android::idmap2::Idmap;
diff --git a/cmds/idmap2/idmap2d/Idmap2Service.cpp b/cmds/idmap2/idmap2d/Idmap2Service.cpp
index 4f65379..8ee79f6 100644
--- a/cmds/idmap2/idmap2d/Idmap2Service.cpp
+++ b/cmds/idmap2/idmap2d/Idmap2Service.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "idmap2d/Idmap2Service.h"
+
 #include <sys/stat.h>   // umask
 #include <sys/types.h>  // umask
 #include <unistd.h>
@@ -28,15 +30,12 @@
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
 #include "binder/IPCThreadState.h"
-#include "utils/String8.h"
-
 #include "idmap2/BinaryStreamVisitor.h"
 #include "idmap2/FileUtils.h"
 #include "idmap2/Idmap.h"
 #include "idmap2/Policies.h"
 #include "idmap2/SysTrace.h"
-
-#include "idmap2d/Idmap2Service.h"
+#include "utils/String8.h"
 
 using android::IPCThreadState;
 using android::binder::Status;
diff --git a/cmds/idmap2/idmap2d/Main.cpp b/cmds/idmap2/idmap2d/Main.cpp
index 4393dcc..2707049 100644
--- a/cmds/idmap2/idmap2d/Main.cpp
+++ b/cmds/idmap2/idmap2d/Main.cpp
@@ -21,13 +21,11 @@
 #include <binder/ProcessState.h>
 
 #include <cstdlib>  // EXIT_{FAILURE,SUCCESS}
-
 #include <iostream>
 #include <sstream>
 
-#include "android-base/macros.h"
-
 #include "Idmap2Service.h"
+#include "android-base/macros.h"
 
 using android::BinderService;
 using android::IPCThreadState;
diff --git a/cmds/idmap2/include/idmap2/Idmap.h b/cmds/idmap2/include/idmap2/Idmap.h
index 5cc0664b..ebbb5ff 100644
--- a/cmds/idmap2/include/idmap2/Idmap.h
+++ b/cmds/idmap2/include/idmap2/Idmap.h
@@ -52,11 +52,9 @@
 #include <vector>
 
 #include "android-base/macros.h"
-
 #include "androidfw/ApkAssets.h"
 #include "androidfw/ResourceTypes.h"
 #include "androidfw/StringPiece.h"
-
 #include "idmap2/Policies.h"
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/include/idmap2/Policies.h b/cmds/idmap2/include/idmap2/Policies.h
index cd76b84..90c698c 100644
--- a/cmds/idmap2/include/idmap2/Policies.h
+++ b/cmds/idmap2/include/idmap2/Policies.h
@@ -17,11 +17,10 @@
 #include <string>
 #include <vector>
 
+#include "Result.h"
 #include "androidfw/ResourceTypes.h"
 #include "androidfw/StringPiece.h"
 
-#include "Result.h"
-
 #ifndef IDMAP2_INCLUDE_IDMAP2_POLICIES_H_
 #define IDMAP2_INCLUDE_IDMAP2_POLICIES_H_
 
diff --git a/cmds/idmap2/include/idmap2/PrettyPrintVisitor.h b/cmds/idmap2/include/idmap2/PrettyPrintVisitor.h
index c388f4b..5111bb2 100644
--- a/cmds/idmap2/include/idmap2/PrettyPrintVisitor.h
+++ b/cmds/idmap2/include/idmap2/PrettyPrintVisitor.h
@@ -21,7 +21,6 @@
 #include <memory>
 
 #include "androidfw/AssetManager2.h"
-
 #include "idmap2/Idmap.h"
 
 namespace android {
diff --git a/cmds/idmap2/include/idmap2/RawPrintVisitor.h b/cmds/idmap2/include/idmap2/RawPrintVisitor.h
index 7e33b3b..2e543d4 100644
--- a/cmds/idmap2/include/idmap2/RawPrintVisitor.h
+++ b/cmds/idmap2/include/idmap2/RawPrintVisitor.h
@@ -22,7 +22,6 @@
 #include <string>
 
 #include "androidfw/AssetManager2.h"
-
 #include "idmap2/Idmap.h"
 
 namespace android {
diff --git a/cmds/idmap2/include/idmap2/ResourceUtils.h b/cmds/idmap2/include/idmap2/ResourceUtils.h
index 1d81c48..8797a78 100644
--- a/cmds/idmap2/include/idmap2/ResourceUtils.h
+++ b/cmds/idmap2/include/idmap2/ResourceUtils.h
@@ -21,7 +21,6 @@
 #include <string>
 
 #include "androidfw/AssetManager2.h"
-
 #include "idmap2/Idmap.h"
 #include "idmap2/Result.h"
 #include "idmap2/ZipFile.h"
diff --git a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp
index 9651328..dee2d21 100644
--- a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp
+++ b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp
@@ -14,14 +14,14 @@
  * limitations under the License.
  */
 
+#include "idmap2/BinaryStreamVisitor.h"
+
 #include <algorithm>
 #include <cstring>
 #include <string>
 
 #include "android-base/macros.h"
 
-#include "idmap2/BinaryStreamVisitor.h"
-
 namespace android::idmap2 {
 
 void BinaryStreamVisitor::Write16(uint16_t value) {
diff --git a/cmds/idmap2/libidmap2/CommandLineOptions.cpp b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
index d5fd2ce..5b0ae92 100644
--- a/cmds/idmap2/libidmap2/CommandLineOptions.cpp
+++ b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "idmap2/CommandLineOptions.h"
+
 #include <algorithm>
 #include <iomanip>
 #include <iostream>
@@ -24,8 +26,6 @@
 #include <vector>
 
 #include "android-base/macros.h"
-
-#include "idmap2/CommandLineOptions.h"
 #include "idmap2/Result.h"
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/libidmap2/FileUtils.cpp b/cmds/idmap2/libidmap2/FileUtils.cpp
index a9b68cd..3e8e329 100644
--- a/cmds/idmap2/libidmap2/FileUtils.cpp
+++ b/cmds/idmap2/libidmap2/FileUtils.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "idmap2/FileUtils.h"
+
 #include <dirent.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -33,8 +35,6 @@
 #include "android-base/stringprintf.h"
 #include "private/android_filesystem_config.h"
 
-#include "idmap2/FileUtils.h"
-
 namespace android::idmap2::utils {
 
 std::unique_ptr<std::vector<std::string>> FindFiles(const std::string& root, bool recurse,
diff --git a/cmds/idmap2/libidmap2/Idmap.cpp b/cmds/idmap2/libidmap2/Idmap.cpp
index 49470b4..aec1a6f 100644
--- a/cmds/idmap2/libidmap2/Idmap.cpp
+++ b/cmds/idmap2/libidmap2/Idmap.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "idmap2/Idmap.h"
+
 #include <algorithm>
 #include <iostream>
 #include <iterator>
@@ -28,14 +30,12 @@
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
 #include "androidfw/AssetManager2.h"
-#include "utils/String16.h"
-#include "utils/String8.h"
-
-#include "idmap2/Idmap.h"
 #include "idmap2/ResourceUtils.h"
 #include "idmap2/Result.h"
 #include "idmap2/SysTrace.h"
 #include "idmap2/ZipFile.h"
+#include "utils/String16.h"
+#include "utils/String8.h"
 
 namespace android::idmap2 {
 
diff --git a/cmds/idmap2/libidmap2/Policies.cpp b/cmds/idmap2/libidmap2/Policies.cpp
index 7c45556..0a0cecf 100644
--- a/cmds/idmap2/libidmap2/Policies.cpp
+++ b/cmds/idmap2/libidmap2/Policies.cpp
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
 
+#include "idmap2/Policies.h"
+
 #include <iterator>
 #include <map>
 #include <string>
 #include <vector>
 
 #include "androidfw/ResourceTypes.h"
-
 #include "idmap2/Idmap.h"
-#include "idmap2/Policies.h"
 #include "idmap2/Result.h"
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
index fc967799..fbf2c77 100644
--- a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
+++ b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
+#include "idmap2/PrettyPrintVisitor.h"
+
 #include <string>
 
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
 #include "androidfw/ApkAssets.h"
-
-#include "idmap2/PrettyPrintVisitor.h"
 #include "idmap2/ResourceUtils.h"
 #include "idmap2/Result.h"
 
diff --git a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
index 1149c90..dd14fd4 100644
--- a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
+++ b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
@@ -14,14 +14,14 @@
  * limitations under the License.
  */
 
+#include "idmap2/RawPrintVisitor.h"
+
 #include <cstdarg>
 #include <string>
 
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
 #include "androidfw/ApkAssets.h"
-
-#include "idmap2/RawPrintVisitor.h"
 #include "idmap2/ResourceUtils.h"
 #include "idmap2/Result.h"
 
diff --git a/cmds/idmap2/libidmap2/ResourceUtils.cpp b/cmds/idmap2/libidmap2/ResourceUtils.cpp
index a24836d..71ba3f0 100644
--- a/cmds/idmap2/libidmap2/ResourceUtils.cpp
+++ b/cmds/idmap2/libidmap2/ResourceUtils.cpp
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
+#include "idmap2/ResourceUtils.h"
+
 #include <memory>
 #include <string>
 
 #include "androidfw/StringPiece.h"
 #include "androidfw/Util.h"
-
-#include "idmap2/ResourceUtils.h"
 #include "idmap2/Result.h"
 #include "idmap2/Xml.h"
 #include "idmap2/ZipFile.h"
diff --git a/cmds/idmap2/libidmap2/Result.cpp b/cmds/idmap2/libidmap2/Result.cpp
index 471dab2..1eac25f 100644
--- a/cmds/idmap2/libidmap2/Result.cpp
+++ b/cmds/idmap2/libidmap2/Result.cpp
@@ -14,12 +14,12 @@
  * limitations under the License.
  */
 
+#include "idmap2/Result.h"
+
 #include <cstdarg>
 
 #include "android-base/stringprintf.h"
 
-#include "idmap2/Result.h"
-
 namespace android::idmap2 {
 
 // NOLINTNEXTLINE(cert-dcl50-cpp)
diff --git a/cmds/idmap2/libidmap2/Xml.cpp b/cmds/idmap2/libidmap2/Xml.cpp
index 0075a92..2645868 100644
--- a/cmds/idmap2/libidmap2/Xml.cpp
+++ b/cmds/idmap2/libidmap2/Xml.cpp
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
+#include "idmap2/Xml.h"
+
 #include <map>
 #include <memory>
 #include <string>
 #include <utility>
 
-#include "idmap2/Xml.h"
-
 namespace android::idmap2 {
 
 std::unique_ptr<const Xml> Xml::Create(const uint8_t* data, size_t size, bool copyData) {
diff --git a/cmds/idmap2/libidmap2/ZipFile.cpp b/cmds/idmap2/libidmap2/ZipFile.cpp
index 0f07324..812fd6e 100644
--- a/cmds/idmap2/libidmap2/ZipFile.cpp
+++ b/cmds/idmap2/libidmap2/ZipFile.cpp
@@ -14,11 +14,12 @@
  * limitations under the License.
  */
 
+#include "idmap2/ZipFile.h"
+
 #include <memory>
 #include <string>
 
 #include "idmap2/Result.h"
-#include "idmap2/ZipFile.h"
 
 namespace android::idmap2 {
 
diff --git a/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
index 9a5b633..9cdc86c 100644
--- a/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
+++ b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
@@ -19,17 +19,14 @@
 #include <string>
 #include <utility>
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
+#include "TestHelpers.h"
 #include "androidfw/ApkAssets.h"
 #include "androidfw/Idmap.h"
-
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
 #include "idmap2/BinaryStreamVisitor.h"
 #include "idmap2/Idmap.h"
 
-#include "TestHelpers.h"
-
 using ::testing::NotNull;
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/tests/CommandLineOptionsTests.cpp b/cmds/idmap2/tests/CommandLineOptionsTests.cpp
index d567af6..6e83fc9 100644
--- a/cmds/idmap2/tests/CommandLineOptionsTests.cpp
+++ b/cmds/idmap2/tests/CommandLineOptionsTests.cpp
@@ -25,19 +25,16 @@
 #include <string>
 #include <vector>
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
+#include "TestHelpers.h"
 #include "android-base/file.h"
 #include "androidfw/ApkAssets.h"
 #include "androidfw/Idmap.h"
 #include "androidfw/LoadedArsc.h"
-
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
 #include "idmap2/CommandLineOptions.h"
 #include "idmap2/Idmap.h"
 
-#include "TestHelpers.h"
-
 namespace android::idmap2 {
 
 TEST(CommandLineOptionsTests, Flag) {
diff --git a/cmds/idmap2/tests/FileUtilsTests.cpp b/cmds/idmap2/tests/FileUtilsTests.cpp
index 34a0097..f4a306e 100644
--- a/cmds/idmap2/tests/FileUtilsTests.cpp
+++ b/cmds/idmap2/tests/FileUtilsTests.cpp
@@ -15,19 +15,17 @@
  */
 
 #include <dirent.h>
+
 #include <set>
 #include <string>
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
+#include "TestHelpers.h"
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
-#include "private/android_filesystem_config.h"
-
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
 #include "idmap2/FileUtils.h"
-
-#include "TestHelpers.h"
+#include "private/android_filesystem_config.h"
 
 using ::testing::NotNull;
 
diff --git a/cmds/idmap2/tests/Idmap2BinaryTests.cpp b/cmds/idmap2/tests/Idmap2BinaryTests.cpp
index 91bc4dd..47af9b5 100644
--- a/cmds/idmap2/tests/Idmap2BinaryTests.cpp
+++ b/cmds/idmap2/tests/Idmap2BinaryTests.cpp
@@ -34,16 +34,13 @@
 #include <string>
 #include <vector>
 
+#include "TestHelpers.h"
+#include "androidfw/PosixUtils.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
-#include "androidfw/PosixUtils.h"
-#include "private/android_filesystem_config.h"
-
 #include "idmap2/FileUtils.h"
 #include "idmap2/Idmap.h"
-
-#include "TestHelpers.h"
+#include "private/android_filesystem_config.h"
 
 using ::android::util::ExecuteBinary;
 using ::testing::NotNull;
diff --git a/cmds/idmap2/tests/IdmapTests.cpp b/cmds/idmap2/tests/IdmapTests.cpp
index 621f503..90fe9a7 100644
--- a/cmds/idmap2/tests/IdmapTests.cpp
+++ b/cmds/idmap2/tests/IdmapTests.cpp
@@ -15,7 +15,6 @@
  */
 
 #include <cstdio>  // fclose
-
 #include <fstream>
 #include <memory>
 #include <sstream>
@@ -23,18 +22,15 @@
 #include <utility>
 #include <vector>
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
+#include "TestHelpers.h"
 #include "android-base/macros.h"
 #include "androidfw/ApkAssets.h"
-
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
 #include "idmap2/BinaryStreamVisitor.h"
 #include "idmap2/CommandLineOptions.h"
 #include "idmap2/Idmap.h"
 
-#include "TestHelpers.h"
-
 using ::testing::IsNull;
 using ::testing::NotNull;
 
diff --git a/cmds/idmap2/tests/Main.cpp b/cmds/idmap2/tests/Main.cpp
index 2b13fed..3e753e9 100644
--- a/cmds/idmap2/tests/Main.cpp
+++ b/cmds/idmap2/tests/Main.cpp
@@ -16,11 +16,9 @@
 
 #include <string>
 
-#include "android-base/file.h"
-
-#include "gtest/gtest.h"
-
 #include "TestHelpers.h"
+#include "android-base/file.h"
+#include "gtest/gtest.h"
 
 namespace android::idmap2 {
 
diff --git a/cmds/idmap2/tests/PoliciesTests.cpp b/cmds/idmap2/tests/PoliciesTests.cpp
index a76da53..e30da76 100644
--- a/cmds/idmap2/tests/PoliciesTests.cpp
+++ b/cmds/idmap2/tests/PoliciesTests.cpp
@@ -16,9 +16,8 @@
 
 #include <string>
 
-#include "gtest/gtest.h"
-
 #include "TestHelpers.h"
+#include "gtest/gtest.h"
 #include "idmap2/Policies.h"
 
 using android::idmap2::PolicyBitmask;
diff --git a/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp b/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp
index 27a3880..c412504 100644
--- a/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp
+++ b/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp
@@ -18,18 +18,15 @@
 #include <sstream>
 #include <string>
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
+#include "TestHelpers.h"
 #include "androidfw/ApkAssets.h"
 #include "androidfw/Idmap.h"
-
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
 #include "idmap2/Idmap.h"
 #include "idmap2/Policies.h"
 #include "idmap2/PrettyPrintVisitor.h"
 
-#include "TestHelpers.h"
-
 using ::testing::NotNull;
 
 using android::ApkAssets;
diff --git a/cmds/idmap2/tests/RawPrintVisitorTests.cpp b/cmds/idmap2/tests/RawPrintVisitorTests.cpp
index 7372148..64518fd 100644
--- a/cmds/idmap2/tests/RawPrintVisitorTests.cpp
+++ b/cmds/idmap2/tests/RawPrintVisitorTests.cpp
@@ -19,14 +19,12 @@
 #include <sstream>
 #include <string>
 
+#include "TestHelpers.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
 #include "idmap2/Idmap.h"
 #include "idmap2/RawPrintVisitor.h"
 
-#include "TestHelpers.h"
-
 using ::testing::NotNull;
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/tests/ResourceUtilsTests.cpp b/cmds/idmap2/tests/ResourceUtilsTests.cpp
index ad78685..9ed807c 100644
--- a/cmds/idmap2/tests/ResourceUtilsTests.cpp
+++ b/cmds/idmap2/tests/ResourceUtilsTests.cpp
@@ -17,15 +17,13 @@
 #include <memory>
 #include <string>
 
+#include "TestHelpers.h"
+#include "androidfw/ApkAssets.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
-#include "androidfw/ApkAssets.h"
 #include "idmap2/ResourceUtils.h"
 #include "idmap2/Result.h"
 
-#include "TestHelpers.h"
-
 using ::testing::NotNull;
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/tests/ResultTests.cpp b/cmds/idmap2/tests/ResultTests.cpp
index 5f4daed..cbced0a 100644
--- a/cmds/idmap2/tests/ResultTests.cpp
+++ b/cmds/idmap2/tests/ResultTests.cpp
@@ -20,7 +20,6 @@
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
 #include "idmap2/Result.h"
 
 namespace android::idmap2 {
diff --git a/cmds/idmap2/tests/TestHelpers.h b/cmds/idmap2/tests/TestHelpers.h
index 45525a5..adea329 100644
--- a/cmds/idmap2/tests/TestHelpers.h
+++ b/cmds/idmap2/tests/TestHelpers.h
@@ -19,6 +19,9 @@
 
 #include <string>
 
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
 namespace android::idmap2 {
 
 const unsigned char idmap_raw_data[] = {
diff --git a/cmds/idmap2/tests/XmlTests.cpp b/cmds/idmap2/tests/XmlTests.cpp
index fe79d8f..df63211 100644
--- a/cmds/idmap2/tests/XmlTests.cpp
+++ b/cmds/idmap2/tests/XmlTests.cpp
@@ -16,13 +16,11 @@
 
 #include <cstdio>  // fclose
 
-#include "idmap2/Xml.h"
-#include "idmap2/ZipFile.h"
-
+#include "TestHelpers.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
-#include "TestHelpers.h"
+#include "idmap2/Xml.h"
+#include "idmap2/ZipFile.h"
 
 using ::testing::IsNull;
 using ::testing::NotNull;
diff --git a/cmds/idmap2/tests/ZipFileTests.cpp b/cmds/idmap2/tests/ZipFileTests.cpp
index 79be43c..3fca436 100644
--- a/cmds/idmap2/tests/ZipFileTests.cpp
+++ b/cmds/idmap2/tests/ZipFileTests.cpp
@@ -17,13 +17,11 @@
 #include <cstdio>  // fclose
 #include <string>
 
-#include "idmap2/Result.h"
-#include "idmap2/ZipFile.h"
-
+#include "TestHelpers.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-
-#include "TestHelpers.h"
+#include "idmap2/Result.h"
+#include "idmap2/ZipFile.h"
 
 using ::testing::IsNull;
 using ::testing::NotNull;