summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-11-22 09:11:19 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-11-22 09:11:19 +0000
commit509a07ad6d6aed85a63ca04661b9993867b43b11 (patch)
tree9337d288dcceb5e1554a7bb952436ebe63ac0ed9
parent5657c75f91ae7c2a9b130d8bf256ba6fda07975f (diff)
tests: add missing sd_event_add_post to test_basic
-rw-r--r--src/libsystemd/sd-event/test-event.c12
1 files changed, 12 insertions, 0 deletions
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);