summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ryan Prichard <rprichard@google.com> 2025-01-06 17:00:42 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-06 17:00:42 -0800
commite963fbdf70dc9eb223bf53060e294bd89282d111 (patch)
tree4d1316a108e26ffb045b0830acae37bf70edae5e
parent12d3983ca5fed8f7926acf8c48b75eac64b4420e (diff)
parentac23d22291562b984c192a7306d4748a640b85f8 (diff)
Merge "binder: declare main in global NS, w/o extern "C"" into main
-rw-r--r--libs/binder/tests/binderSafeInterfaceTest.cpp11
-rw-r--r--libs/binderdebug/stats.cpp6
-rw-r--r--libs/binderdebug/tests/binderdebug_test.cpp13
3 files changed, 17 insertions, 13 deletions
diff --git a/libs/binder/tests/binderSafeInterfaceTest.cpp b/libs/binder/tests/binderSafeInterfaceTest.cpp
index 7d1556e7d2..45b2103637 100644
--- a/libs/binder/tests/binderSafeInterfaceTest.cpp
+++ b/libs/binder/tests/binderSafeInterfaceTest.cpp
@@ -858,7 +858,13 @@ TEST_F(SafeInterfaceTest, TestIncrementTwo) {
ASSERT_EQ(b + 1, bPlusOne);
}
-extern "C" int main(int argc, char **argv) {
+} // namespace tests
+} // namespace android
+
+int main(int argc, char** argv) {
+ using namespace android;
+ using namespace android::tests;
+
testing::InitGoogleTest(&argc, argv);
if (fork() == 0) {
@@ -875,6 +881,3 @@ extern "C" int main(int argc, char **argv) {
return RUN_ALL_TESTS();
}
-
-} // namespace tests
-} // namespace android
diff --git a/libs/binderdebug/stats.cpp b/libs/binderdebug/stats.cpp
index 9c26afaa97..972fbd5295 100644
--- a/libs/binderdebug/stats.cpp
+++ b/libs/binderdebug/stats.cpp
@@ -22,9 +22,9 @@
#include <inttypes.h>
-namespace android {
+int main() {
+ using namespace android;
-extern "C" int main() {
// ignore args - we only print csv
// we should use a csv library here for escaping, because
@@ -58,5 +58,3 @@ extern "C" int main() {
}
return 0;
}
-
-} // namespace android
diff --git a/libs/binderdebug/tests/binderdebug_test.cpp b/libs/binderdebug/tests/binderdebug_test.cpp
index ea799c06a2..ad2b581abc 100644
--- a/libs/binderdebug/tests/binderdebug_test.cpp
+++ b/libs/binderdebug/tests/binderdebug_test.cpp
@@ -60,8 +60,15 @@ TEST(BinderDebugTests, BinderThreads) {
EXPECT_GE(pidInfo.threadCount, 1);
}
-extern "C" {
+} // namespace test
+} // namespace binderdebug
+} // namespace android
+
int main(int argc, char** argv) {
+ using namespace android;
+ using namespace android::binderdebug;
+ using namespace android::binderdebug::test;
+
::testing::InitGoogleTest(&argc, argv);
// Create a child/client process to call into the main process so we can ensure
@@ -84,7 +91,3 @@ int main(int argc, char** argv) {
return RUN_ALL_TESTS();
}
-} // extern "C"
-} // namespace test
-} // namespace binderdebug
-} // namespace android