Loading libs/binder/tests/IBinderRpcTest.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ interface IBinderRpcTest { // number of known RPC binders to process, RpcState::countBinders by session int[] countBinders(); // Return a null binder with a non-nullable return type. IBinder getNullBinder(); // Caller sends server, callee pings caller's server and returns error code. int pingMe(IBinder binder); @nullable IBinder repeatBinder(@nullable IBinder binder); Loading libs/binder/tests/binderRpcTest.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,10 @@ public: } return Status::ok(); } Status getNullBinder(sp<IBinder>* out) override { out->clear(); return Status::ok(); } Status pingMe(const sp<IBinder>& binder, int32_t* out) override { if (binder == nullptr) { std::cout << "Received null binder!" << std::endl; Loading Loading @@ -802,6 +806,13 @@ TEST_P(BinderRpc, SendAndGetResultBackBig) { EXPECT_EQ(single + single, doubled); } TEST_P(BinderRpc, InvalidNullBinderReturn) { auto proc = createRpcTestSocketServerProcess({}); sp<IBinder> outBinder; EXPECT_EQ(proc.rootIface->getNullBinder(&outBinder).transactionError(), UNEXPECTED_NULL); } TEST_P(BinderRpc, CallMeBack) { auto proc = createRpcTestSocketServerProcess({}); Loading Loading
libs/binder/tests/IBinderRpcTest.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ interface IBinderRpcTest { // number of known RPC binders to process, RpcState::countBinders by session int[] countBinders(); // Return a null binder with a non-nullable return type. IBinder getNullBinder(); // Caller sends server, callee pings caller's server and returns error code. int pingMe(IBinder binder); @nullable IBinder repeatBinder(@nullable IBinder binder); Loading
libs/binder/tests/binderRpcTest.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,10 @@ public: } return Status::ok(); } Status getNullBinder(sp<IBinder>* out) override { out->clear(); return Status::ok(); } Status pingMe(const sp<IBinder>& binder, int32_t* out) override { if (binder == nullptr) { std::cout << "Received null binder!" << std::endl; Loading Loading @@ -802,6 +806,13 @@ TEST_P(BinderRpc, SendAndGetResultBackBig) { EXPECT_EQ(single + single, doubled); } TEST_P(BinderRpc, InvalidNullBinderReturn) { auto proc = createRpcTestSocketServerProcess({}); sp<IBinder> outBinder; EXPECT_EQ(proc.rootIface->getNullBinder(&outBinder).transactionError(), UNEXPECTED_NULL); } TEST_P(BinderRpc, CallMeBack) { auto proc = createRpcTestSocketServerProcess({}); Loading