summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/test-bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-12 01:16:40 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-12 01:19:32 +0200
commite9a967f9a0e9b2bf705a776c34635e6d1df73f1b (patch)
tree5649237602c08930561f13e2704a6bd95f8c5b90 /src/libsystemd-bus/test-bus-kernel.c
parent8e2f9ebf28f93241ed36469302e76de498aa8e87 (diff)
bus: make kdbus work so that we can exchange real messages
We have ignition, we have tremendous fire!
Diffstat (limited to 'src/libsystemd-bus/test-bus-kernel.c')
-rw-r--r--src/libsystemd-bus/test-bus-kernel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libsystemd-bus/test-bus-kernel.c b/src/libsystemd-bus/test-bus-kernel.c
index 2241e65adf..4c599788fe 100644
--- a/src/libsystemd-bus/test-bus-kernel.c
+++ b/src/libsystemd-bus/test-bus-kernel.c
@@ -29,7 +29,8 @@
int main(int argc, char *argv[]) {
_cleanup_close_ int bus_ref = -1;
_cleanup_free_ char *bus_name = NULL, *address = NULL;
- const char *ua = NULL, *ub = NULL;
+ _cleanup_bus_message_unref_ sd_bus_message *m = NULL;
+ const char *ua = NULL, *ub = NULL, *the_string = NULL;
sd_bus *a, *b;
int r;
@@ -67,6 +68,17 @@ int main(int argc, char *argv[]) {
printf("unique b: %s\n", ub);
+ r = sd_bus_emit_signal(a, "/foo", "waldo.com", "Piep", "s", "I am a string");
+ assert_se(r >= 0);
+
+ r = sd_bus_process(b, &m);
+ assert_se(r > 0);
+ assert_se(m);
+
+ r = sd_bus_message_read(m, "s", &the_string);
+ assert_se(r >= 0);
+ assert_se(streq(the_string, "I am a string"));
+
sd_bus_unref(a);
sd_bus_unref(b);