diff options
| author | 2017-12-13 02:43:44 +0000 | |
|---|---|---|
| committer | 2017-12-13 02:43:44 +0000 | |
| commit | 99c6ca2da04782f66ab75ecb58a11d1e468412ce (patch) | |
| tree | 9d64b14b9f50008c40c64e118ff480ae30adea1c | |
| parent | 9afc73021f3e744804cec614c89a07327e2b8546 (diff) | |
| parent | f0745d15ea84f22f9a5630d1aad3594c6a38b610 (diff) | |
Merge "Accept EAGAIN on a binder transaction." am: 2b23a55901
am: f0745d15ea
Change-Id: I38ab5a6ce1400b0acf7c2445891195ce7a8d4ab8
| -rw-r--r-- | libs/binder/tests/binderDriverInterfaceTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp index b14631dbda..4f00bc13bc 100644 --- a/libs/binder/tests/binderDriverInterfaceTest.cpp +++ b/libs/binder/tests/binderDriverInterfaceTest.cpp @@ -77,6 +77,16 @@ class BinderDriverInterfaceTest : public ::testing::Test { virtual void TearDown() { } protected: + /* The ioctl must either return 0, or if it doesn't errno should be accepted_errno */ + void binderTestIoctlSuccessOrError(int cmd, void *arg, int accepted_errno) { + int ret; + + ret = ioctl(m_binderFd, cmd, arg); + if (ret != 0) { + EXPECT_EQ(errno, accepted_errno); + } + } + void binderTestIoctlRetErr2(int cmd, void *arg, int expect_ret, int expect_errno, int accept_errno) { int ret; @@ -256,7 +266,7 @@ TEST_F(BinderDriverInterfaceTest, Transaction) { { SCOPED_TRACE("1st WriteRead"); - binderTestIoctl(BINDER_WRITE_READ, &bwr); + binderTestIoctlSuccessOrError(BINDER_WRITE_READ, &bwr, EAGAIN); } EXPECT_EQ(sizeof(bc1), bwr.write_consumed); if (bwr.read_consumed < offsetof(typeof(br), pad)) { |