diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-12 20:17:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-12 20:17:15 +0200 |
commit | 3583882c4ff8ced09867691175e1a7396ae8e413 (patch) | |
tree | 69506852f115a471d5cb41b0afa4e7d348b9dcd0 /src/libsystemd-bus/test-bus-kernel.c | |
parent | 51038c03263b2db1d63f495327267b29b3fa9656 (diff) |
bus: add kdbus test for name registry
Diffstat (limited to 'src/libsystemd-bus/test-bus-kernel.c')
-rw-r--r-- | src/libsystemd-bus/test-bus-kernel.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libsystemd-bus/test-bus-kernel.c b/src/libsystemd-bus/test-bus-kernel.c index e84e45ad2b..19fae1dd72 100644 --- a/src/libsystemd-bus/test-bus-kernel.c +++ b/src/libsystemd-bus/test-bus-kernel.c @@ -85,9 +85,29 @@ int main(int argc, char *argv[]) { assert_se(r >= 0); assert_se(streq(the_string, "I am a string")); + sd_bus_message_unref(m); + m = NULL; + r = sd_bus_request_name(a, "net.0pointer.foobar", 0); assert_se(r >= 0); + r = sd_bus_message_new_method_call(b, "net.0pointer.foobar", "/a/path", "an.inter.face", "AMethod", &m); + assert_se(r >= 0); + + r = sd_bus_send(b, m, NULL); + assert_se(r >= 0); + + for (;;) { + sd_bus_message_unref(m); + m = NULL; + r = sd_bus_process(a, &m); + assert_se(r > 0); + assert_se(m); + + bus_message_dump(m); + assert_se(sd_bus_message_rewind(m, true) >= 0); + } + r = sd_bus_release_name(a, "net.0pointer.foobar"); assert_se(r >= 0); |