summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-07-10 11:12:42 -0700
committer Steven Moreland <smoreland@google.com> 2019-07-10 18:53:33 +0000
commit37f1892d61daf50de166906b7a828586e334a0fc (patch)
tree20981b953e6e9c276a8a011d96eb282a25d414ba
parente416f707865e0a5ffedf13a1c91495146adc895c (diff)
binderDriverInterfaceTest: fix failure
After servicemanager was re-written in C++, it started returning a 4-byte payload for ping. Whereas before, in the C implementation, a zero byte payload was returned. Allowing multiple values in this test to stop presubmit failures. As a follow-up, I will try to determine if we can switch libbinder to a 0-byte ping (and revert this CL). Alternatively, once SM is in all branches, if we want this behavior, we can restrict this test to 4-bytes OR we can remove this expected value from this test altogether. This test is allowing both values and being fixed in this strange way because an investigation will follow, and our branching structure (and vendor prebuilts) make it hard to revert the offending change. Fixes: 136633463 Bug: 137203409 Test: binderDriverInterfaceTest passes (on devices with and w/o and updated SM) Change-Id: I43a5d10c59ae71933db40d932716cd979f802cc5
-rw-r--r--libs/binder/tests/binderDriverInterfaceTest.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp
index 77ebac8f5a..6508bb1283 100644
--- a/libs/binder/tests/binderDriverInterfaceTest.cpp
+++ b/libs/binder/tests/binderDriverInterfaceTest.cpp
@@ -286,7 +286,13 @@ TEST_F(BinderDriverInterfaceTest, Transaction) {
EXPECT_EQ(0u, br.arg2.cookie);
EXPECT_EQ(0u, br.arg2.code);
EXPECT_EQ(0u, br.arg2.flags);
- EXPECT_EQ(0u, br.arg2.data_size);
+
+ // ping returns a 4 byte header in libbinder, but the original
+ // C implementation of servicemanager returns a 0 byte header
+ if (br.arg2.data_size != 0 && br.arg2.data_size != 4) {
+ ADD_FAILURE() << br.arg2.data_size << " is expected to be 0 or 4";
+ }
+
EXPECT_EQ(0u, br.arg2.offsets_size);
SCOPED_TRACE("3rd WriteRead");