From 3d79be886912aa32399049da8df8dea3052581cc Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 15 Jul 2019 17:54:11 -0700 Subject: libbinder: delete tests for linkToDeath w/ no ref These tests succeeded before because of a circular reference that held onto a binder when it was linked to death. Now that this circular link is broken, these tests fail. Bug: 137587622 Bug: 137212433 Test: binderLibTest Change-Id: Iaf150012d8883b642c9b3cd065d4a2299cbffb79 --- libs/binder/tests/binderLibTest.cpp | 44 ------------------------------------- 1 file changed, 44 deletions(-) diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp index 99a71bd662..cf83faa8cf 100644 --- a/libs/binder/tests/binderLibTest.cpp +++ b/libs/binder/tests/binderLibTest.cpp @@ -550,50 +550,6 @@ TEST_F(BinderLibTest, AddServer) ASSERT_TRUE(server != nullptr); } -TEST_F(BinderLibTest, DeathNotificationNoRefs) -{ - status_t ret; - - sp testDeathRecipient = new TestDeathRecipient(); - - { - sp binder = addServer(); - ASSERT_TRUE(binder != nullptr); - ret = binder->linkToDeath(testDeathRecipient); - EXPECT_EQ(NO_ERROR, ret); - } - IPCThreadState::self()->flushCommands(); - ret = testDeathRecipient->waitEvent(5); - EXPECT_EQ(NO_ERROR, ret); -#if 0 /* Is there an unlink api that does not require a strong reference? */ - ret = binder->unlinkToDeath(testDeathRecipient); - EXPECT_EQ(NO_ERROR, ret); -#endif -} - -TEST_F(BinderLibTest, DeathNotificationWeakRef) -{ - status_t ret; - wp wbinder; - - sp testDeathRecipient = new TestDeathRecipient(); - - { - sp binder = addServer(); - ASSERT_TRUE(binder != nullptr); - ret = binder->linkToDeath(testDeathRecipient); - EXPECT_EQ(NO_ERROR, ret); - wbinder = binder; - } - IPCThreadState::self()->flushCommands(); - ret = testDeathRecipient->waitEvent(5); - EXPECT_EQ(NO_ERROR, ret); -#if 0 /* Is there an unlink api that does not require a strong reference? */ - ret = binder->unlinkToDeath(testDeathRecipient); - EXPECT_EQ(NO_ERROR, ret); -#endif -} - TEST_F(BinderLibTest, DeathNotificationStrongRef) { status_t ret; -- cgit v1.2.3-59-g8ed1b