Add a few missing pthread tests.

This seems to be all that's tested by system/extras/tests/bionic that isn't
already better tested here.

Change-Id: Id0aa985cefd4047a6007ba9804f541069d9e92ed
This commit is contained in:
Elliott Hughes 2015-12-14 17:35:10 -08:00
parent b34ae08cc6
commit d31d4c1cc6

View File

@ -1536,6 +1536,9 @@ TEST(pthread, pthread_mutex_lock_NORMAL) {
ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(EBUSY, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
}
TEST(pthread, pthread_mutex_lock_ERRORCHECK) {
@ -1558,6 +1561,8 @@ TEST(pthread, pthread_mutex_lock_RECURSIVE) {
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(EPERM, pthread_mutex_unlock(&m.lock));
}