summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sherry Yang <sherryy@android.com> 2017-08-29 16:07:57 -0700
committer Sherry Yang <sherryy@android.com> 2017-08-29 16:20:21 -0700
commit2437b322fcc85bb3b03b5488bb71bdb2baa6ab4b (patch)
tree5bbb61e1aad7516b52b03805e5dc675d5d73aa71
parent74a871ae12c00b10daffca7621922ae8f55a209c (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.cpp6
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);
}