diff --git a/power.cpp b/power.cpp index e9b6ccd..74abac9 100644 --- a/power.cpp +++ b/power.cpp @@ -44,6 +44,7 @@ int acquire_wake_lock(int, const char* id) { ATRACE_CALL(); const auto& suspendService = getSystemSuspendServiceOnce(); if (!suspendService) { + LOG(ERROR) << "ISystemSuspend::getService() failed."; return -1; } diff --git a/power_test.cpp b/power_test.cpp index 601df64..1ade263 100644 --- a/power_test.cpp +++ b/power_test.cpp @@ -73,8 +73,10 @@ TEST(LibpowerTest, WakeLockStressTest) { for (int j = 0; j < numLocks; j++) { // We want ids to be unique. std::string id = std::to_string(i) + "/" + std::to_string(j); - ASSERT_EQ(acquire_wake_lock(PARTIAL_WAKE_LOCK, id.c_str()), 0); - ASSERT_EQ(release_wake_lock(id.c_str()), 0); + ASSERT_EQ(acquire_wake_lock(PARTIAL_WAKE_LOCK, id.c_str()), 0) + << "id: " << id; + ASSERT_EQ(release_wake_lock(id.c_str()), 0) + << "id: " << id;; } }); }