diff options
Diffstat (limited to 'tests/t_event.c')
| -rw-r--r-- | tests/t_event.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/t_event.c b/tests/t_event.c index 706a285..1908dc9 100644 --- a/tests/t_event.c +++ b/tests/t_event.c | |||
| @@ -263,9 +263,18 @@ static void case_add_nothing_then_ask(void) { | |||
| 263 | pair_close(); | 263 | pair_close(); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | /* Whether a worker thread may register a descriptor while this one waits | ||
| 267 | depends on who keeps the set. Tying the answer to the mechanism's name | ||
| 268 | here means a backend added later cannot quietly forget to say. */ | ||
| 269 | static void case_sharing_matches_the_mechanism(void) { | ||
| 270 | test_case("only a set the kernel keeps may be changed from another thread"); | ||
| 271 | CHECK_INT(event_can_share(), strcmp(event_mechanism(), "poll") ? 1 : 0); | ||
| 272 | } | ||
| 273 | |||
| 266 | void test_event(void) { | 274 | void test_event(void) { |
| 267 | CHECK_INT(event_init(), 0); | 275 | CHECK_INT(event_init(), 0); |
| 268 | CHECK(event_mechanism() != NULL); | 276 | CHECK(event_mechanism() != NULL); |
| 277 | case_sharing_matches_the_mechanism(); | ||
| 269 | 278 | ||
| 270 | case_readable(); | 279 | case_readable(); |
| 271 | case_writable(); | 280 | case_writable(); |
