From 509a07ad6d6aed85a63ca04661b9993867b43b11 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Sun, 22 Nov 2015 09:11:19 +0000 Subject: tests: add missing sd_event_add_post to test_basic --- src/libsystemd/sd-event/test-event.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c index e09fa915eb..4a87159151 100644 --- a/src/libsystemd/sd-event/test-event.c +++ b/src/libsystemd/sd-event/test-event.c @@ -158,6 +158,16 @@ static int exit_handler(sd_event_source *s, void *userdata) { return 3; } +static bool got_post = false; + +static int post_handler(sd_event_source *s, void *userdata) { + log_info("got post handler"); + + got_post = true; + + return 2; +} + static void test_basic(void) { sd_event *e = NULL; sd_event_source *w = NULL, *x = NULL, *y = NULL, *z = NULL, *q = NULL, *t = NULL; @@ -230,10 +240,12 @@ static void test_basic(void) { sd_event_source_unref(y); do_quit = true; + assert_se(sd_event_add_post(e, NULL, post_handler, NULL) >= 0); assert_se(sd_event_source_set_time(z, now(CLOCK_MONOTONIC) + 200 * USEC_PER_MSEC) >= 0); assert_se(sd_event_source_set_enabled(z, SD_EVENT_ONESHOT) >= 0); assert_se(sd_event_loop(e) >= 0); + assert_se(got_post); assert_se(got_exit); sd_event_source_unref(z); -- cgit v1.2.3-54-g00ecf