Lines Matching refs:s
30 sem_t s; in TEST() local
33 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
34 ASSERT_EQ(0, sem_init(&s, 0, 1)); in TEST()
35 ASSERT_EQ(0, sem_init(&s, 0, 123)); in TEST()
39 ASSERT_EQ(-1, sem_init(&s, 0, -1)); in TEST()
45 ASSERT_EQ(0, sem_init(&s, 0, SEM_VALUE_MAX)); in TEST()
49 ASSERT_EQ(-1, sem_init(&s, 0, SEM_VALUE_MAX + 1)); in TEST()
52 ASSERT_EQ(0, sem_destroy(&s)); in TEST()
56 sem_t s; in TEST() local
57 ASSERT_EQ(0, sem_init(&s, 0, 3)); in TEST()
58 ASSERT_EQ(0, sem_trywait(&s)); in TEST()
59 ASSERT_EQ(0, sem_trywait(&s)); in TEST()
60 ASSERT_EQ(0, sem_trywait(&s)); in TEST()
62 ASSERT_EQ(-1, sem_trywait(&s)); in TEST()
64 ASSERT_EQ(0, sem_destroy(&s)); in TEST()
77 sem_t s; in TEST() local
78 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
81 ASSERT_EQ(0, pthread_create(&t1, nullptr, SemWaitThreadFn, &s)); in TEST()
82 ASSERT_EQ(0, pthread_create(&t2, nullptr, SemWaitThreadFn, &s)); in TEST()
83 ASSERT_EQ(0, pthread_create(&t3, nullptr, SemWaitThreadFn, &s)); in TEST()
85 ASSERT_EQ(0, sem_post(&s)); in TEST()
86 ASSERT_EQ(0, sem_post(&s)); in TEST()
87 ASSERT_EQ(0, sem_post(&s)); in TEST()
106 sem_t s; in sem_timedwait_helper() local
107 ASSERT_EQ(0, sem_init(&s, 0, 0)); in sem_timedwait_helper()
114 ASSERT_EQ(-1, wait_function(&s, &ts)); in sem_timedwait_helper()
120 ASSERT_EQ(-1, wait_function(&s, &ts)); in sem_timedwait_helper()
124 ASSERT_EQ(-1, wait_function(&s, &ts)); in sem_timedwait_helper()
130 ASSERT_EQ(-1, wait_function(&s, &ts)); in sem_timedwait_helper()
133 ASSERT_EQ(0, sem_destroy(&s)); in sem_timedwait_helper()
162 sem_t s; in TEST() local
163 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
165 ASSERT_EXIT(sem_timedwait(&s, nullptr), testing::KilledBySignal(SIGSEGV), ""); in TEST()
169 sem_t s; in TEST() local
170 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
173 ASSERT_EQ(0, sem_getvalue(&s, &i)); in TEST()
176 ASSERT_EQ(0, sem_post(&s)); in TEST()
177 ASSERT_EQ(0, sem_getvalue(&s, &i)); in TEST()
180 ASSERT_EQ(0, sem_post(&s)); in TEST()
181 ASSERT_EQ(0, sem_getvalue(&s, &i)); in TEST()
184 ASSERT_EQ(0, sem_wait(&s)); in TEST()
185 ASSERT_EQ(0, sem_getvalue(&s, &i)); in TEST()
218 sem_t s; in TEST() local
219 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
222 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
228 ASSERT_EQ(0, sem_post(&s)); in TEST()
241 sem_t s; in TEST() local
242 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
245 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
251 ASSERT_EQ(0, sem_post(&s)); in TEST()