Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83ded973 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binderAllocationLimits: check remote binder null" into main am:...

Merge "binderAllocationLimits: check remote binder null" into main am: 4061f730 am: fad628bc am: 2b2bb45a am: 1b135b93 am: 1f713007

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2670077



Change-Id: Ifdb9bfe9ae50c7f031cd328300e0e2fe2d2d1065
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a2f76f1f 1f713007
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -216,16 +216,16 @@ TEST(RpcBinderAllocation, SetupRpcServer) {
    auto server = RpcServer::make();
    server->setRootObject(sp<BBinder>::make());

    CHECK_EQ(OK, server->setupUnixDomainServer(addr.c_str()));
    ASSERT_EQ(OK, server->setupUnixDomainServer(addr.c_str()));

    std::thread([server]() { server->join(); }).detach();

    status_t status;
    auto session = RpcSession::make();
    status = session->setupUnixDomainClient(addr.c_str());
    CHECK_EQ(status, OK) << "Could not connect: " << addr << ": " << statusToString(status).c_str();
    status_t status = session->setupUnixDomainClient(addr.c_str());
    ASSERT_EQ(status, OK) << "Could not connect: " << addr << ": " << statusToString(status).c_str();

    auto remoteBinder = session->getRootObject();
    ASSERT_NE(remoteBinder, nullptr);

    size_t mallocs = 0, totalBytes = 0;
    {
@@ -233,7 +233,7 @@ TEST(RpcBinderAllocation, SetupRpcServer) {
            mallocs++;
            totalBytes += bytes;
        });
        CHECK_EQ(OK, remoteBinder->pingBinder());
        ASSERT_EQ(OK, remoteBinder->pingBinder());
    }
    EXPECT_EQ(mallocs, 1);
    EXPECT_EQ(totalBytes, 40);