diff options
author | Kay Sievers <kay@vrfy.org> | 2013-11-07 16:44:33 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-11-07 16:57:16 +0100 |
commit | 15912917ef8b96124bd2553d5ae851c1b113efd8 (patch) | |
tree | 3a253906adf58a89addaa1edf67ec5def35145f5 /src/libsystemd-bus/test-bus-marshal.c | |
parent | e633ea1c9c5249ed5bf708a2ed6385c4823d4706 (diff) |
bus: message_append_basic() - allow string == NULL
Diffstat (limited to 'src/libsystemd-bus/test-bus-marshal.c')
-rw-r--r-- | src/libsystemd-bus/test-bus-marshal.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsystemd-bus/test-bus-marshal.c b/src/libsystemd-bus/test-bus-marshal.c index ae61476d57..5e29a7b6a2 100644 --- a/src/libsystemd-bus/test-bus-marshal.c +++ b/src/libsystemd-bus/test-bus-marshal.c @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *copy = NULL; int r, boolean; - const char *x, *y, *z, *a, *b, *c, *d; + const char *x, *x2, *y, *z, *a, *b, *c, *d; uint8_t u, v; void *buffer = NULL; size_t sz; @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) { assert_se(r >= 0); r = sd_bus_message_append(m, "s", NULL); - assert_se(r < 0); + assert_se(r >= 0); r = sd_bus_message_append(m, "as", 2, "string #1", "string #2"); assert_se(r >= 0); @@ -160,9 +160,10 @@ int main(int argc, char *argv[]) { assert_se(sd_bus_message_rewind(m, true) >= 0); - r = sd_bus_message_read(m, "sas", &x, 2, &y, &z); + r = sd_bus_message_read(m, "ssas", &x, &x2, 2, &y, &z); assert_se(r > 0); assert_se(streq(x, "a string")); + assert_se(streq(x2, "")); assert_se(streq(y, "string #1")); assert_se(streq(z, "string #2")); @@ -241,7 +242,7 @@ int main(int argc, char *argv[]) { assert_se(sd_bus_message_verify_type(m, 's', NULL) > 0); - r = sd_bus_message_skip(m, "sas"); + r = sd_bus_message_skip(m, "ssas"); assert_se(r > 0); assert_se(sd_bus_message_verify_type(m, 's', NULL) > 0); |