diff options
| author | 2017-08-29 16:07:57 -0700 | |
|---|---|---|
| committer | 2017-08-29 16:20:21 -0700 | |
| commit | 2437b322fcc85bb3b03b5488bb71bdb2baa6ab4b (patch) | |
| tree | 5bbb61e1aad7516b52b03805e5dc675d5d73aa71 | |
| parent | 74a871ae12c00b10daffca7621922ae8f55a209c (diff) | |
Add test to open and close with no mmap
Add a test to check that alloc->buffers
is properly initialized when calling
close after open with no mmap.
Bug: 36007193
Test: run binderDriverInterfaceTest
Change-Id: I94af8499e65714b1b09ac063459eacf05504262a
Signed-off-by: Sherry Yang <sherryy@android.com>
| -rw-r--r-- | libs/binder/tests/binderDriverInterfaceTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp index ff5912fbe1..b14631dbda 100644 --- a/libs/binder/tests/binderDriverInterfaceTest.cpp +++ b/libs/binder/tests/binderDriverInterfaceTest.cpp @@ -139,6 +139,12 @@ TEST_F(BinderDriverInterfaceTest, Version) { ASSERT_EQ(BINDER_CURRENT_PROTOCOL_VERSION, version.protocol_version); } +TEST_F(BinderDriverInterfaceTest, OpenNoMmap) { + int binderFd = open(BINDER_DEV_NAME, O_RDWR | O_NONBLOCK | O_CLOEXEC); + ASSERT_GE(binderFd, 0); + close(binderFd); +} + TEST_F(BinderDriverInterfaceTest, WriteReadNull) { binderTestIoctlErr1(BINDER_WRITE_READ, NULL, EFAULT); } |