diff options
| author | 2018-02-07 03:12:21 +0000 | |
|---|---|---|
| committer | 2018-02-07 03:12:21 +0000 | |
| commit | 72ea70f2247b0cb899788352b81d52a0e7635cd5 (patch) | |
| tree | 2d99ce8a82f140968dc89a42ebfaa7755201ccef /libs | |
| parent | b35d58143a35d3992173c2cf3e9d57b37989f5fd (diff) | |
| parent | 142a9ab25a4e841789519a20ab6bd7975a0189a5 (diff) | |
Merge "Accept EAGAIN on a binder transaction." into oreo-mr1-vts-dev
Diffstat (limited to 'libs')
| -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 ff5912fbe1..9b289c0c23 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; @@ -250,7 +260,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)) { |