diff options
author | 2023-06-02 02:10:06 +0000 | |
---|---|---|
committer | 2023-06-02 02:10:06 +0000 | |
commit | 0e23a455abdc9262f20a42cc25e36208e57c637b (patch) | |
tree | ddf23076a2a9c67bdfafe994d58e262e61b2e751 | |
parent | cc6e233122c42d503f9af72d85cfc6030ce5eb9e (diff) | |
parent | eda72fcea6b0b23882c7370323ed25a829ed5025 (diff) |
Merge "libbinder_ndk_unit_test: log service test cbs" am: 88bd7470e0 am: 7609df6865 am: d2a041a4d8 am: 01bd4ee56b am: eda72fcea6
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2611354
Change-Id: I480b61908b81eae8457921a5c5ffa83cf2b13352
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libs/binder/ndk/tests/libbinder_ndk_unit_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/binder/ndk/tests/libbinder_ndk_unit_test.cpp b/libs/binder/ndk/tests/libbinder_ndk_unit_test.cpp index 664894ebac..eba0556023 100644 --- a/libs/binder/ndk/tests/libbinder_ndk_unit_test.cpp +++ b/libs/binder/ndk/tests/libbinder_ndk_unit_test.cpp @@ -107,11 +107,13 @@ class MyBinderNdkUnitTest : public aidl::BnBinderNdkUnitTest { } static bool activeServicesCallback(bool hasClients, void* context) { if (hasClients) { + LOG(INFO) << "hasClients, so not unregistering."; return false; } // Unregister all services if (!AServiceManager_tryUnregister()) { + LOG(INFO) << "Could not unregister service the first time."; // Prevent shutdown (test will fail) return false; } @@ -121,6 +123,7 @@ class MyBinderNdkUnitTest : public aidl::BnBinderNdkUnitTest { // Unregister again before shutdown if (!AServiceManager_tryUnregister()) { + LOG(INFO) << "Could not unregister service the second time."; // Prevent shutdown (test will fail) return false; } @@ -128,6 +131,7 @@ class MyBinderNdkUnitTest : public aidl::BnBinderNdkUnitTest { // Check if the context was passed correctly MyBinderNdkUnitTest* service = static_cast<MyBinderNdkUnitTest*>(context); if (service->contextTestValue != kContextTestValue) { + LOG(INFO) << "Incorrect context value."; // Prevent shutdown (test will fail) return false; } @@ -479,6 +483,8 @@ TEST(NdkBinder, ForcedPersistenceTest) { } TEST(NdkBinder, ActiveServicesCallbackTest) { + LOG(INFO) << "ActiveServicesCallbackTest starting"; + ndk::SpAIBinder binder(AServiceManager_waitForService(kActiveServicesNdkUnitTestService)); std::shared_ptr<aidl::IBinderNdkUnitTest> service = aidl::IBinderNdkUnitTest::fromBinder(binder); @@ -489,6 +495,7 @@ TEST(NdkBinder, ActiveServicesCallbackTest) { service = nullptr; IPCThreadState::self()->flushCommands(); + LOG(INFO) << "ActiveServicesCallbackTest about to sleep"; sleep(kShutdownWaitTime); ASSERT_FALSE(isServiceRunning(kActiveServicesNdkUnitTestService)) |