Merge "sem_timedwait with a null timeout doesn't mean "forever"."

This commit is contained in:
Elliott Hughes
2015-12-17 01:15:15 +00:00
committed by Gerrit Code Review
6 changed files with 24 additions and 14 deletions

View File

@@ -131,6 +131,13 @@ TEST(semaphore, sem_timedwait) {
ASSERT_EQ(0, sem_destroy(&s));
}
TEST(semaphore_DeathTest, sem_timedwait_null_timeout) {
sem_t s;
ASSERT_EQ(0, sem_init(&s, 0, 0));
ASSERT_EXIT(sem_timedwait(&s, nullptr), testing::KilledBySignal(SIGSEGV), "");
}
TEST(semaphore, sem_getvalue) {
sem_t s;
ASSERT_EQ(0, sem_init(&s, 0, 0));