summaryrefslogtreecommitdiffstats
path: root/tests/pthread_test.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-02 15:24:26 -0700
committerDan Albert <danalbert@google.com>2014-09-02 15:24:26 -0700
commit1d53ae2a01df5c85d23b01e44880103e118712f3 (patch)
treea12e3f3fa3ff8eaa6a1e61fb73c2b9f357229799 /tests/pthread_test.cpp
parent5120bcf9f11951bffd8ac595c2b70252ed4a4958 (diff)
downloadbionic-1d53ae2a01df5c85d23b01e44880103e118712f3.zip
bionic-1d53ae2a01df5c85d23b01e44880103e118712f3.tar.gz
bionic-1d53ae2a01df5c85d23b01e44880103e118712f3.tar.bz2
Prevent a few test pthread keys from leaking.
Bug: 17358010 Change-Id: Ie718dc215ddfd431650295a1630c1b1716760c3d
Diffstat (limited to 'tests/pthread_test.cpp')
-rw-r--r--tests/pthread_test.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 6557738..bbac7fe 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -105,6 +105,7 @@ TEST(pthread, pthread_key_fork) {
ASSERT_EQ(99, WEXITSTATUS(status));
ASSERT_EQ(expected, pthread_getspecific(key));
+ ASSERT_EQ(0, pthread_key_delete(key));
}
static void* DirtyKeyFn(void* key) {
@@ -132,6 +133,7 @@ TEST(pthread, pthread_key_dirty) {
ASSERT_EQ(nullptr, result); // Not ~0!
ASSERT_EQ(0, munmap(stack, stack_size));
+ ASSERT_EQ(0, pthread_key_delete(key));
}
static void* IdFn(void* arg) {