summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/test-bus-gvariant.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2015-01-30 13:53:45 +0100
committerKay Sievers <kay@vrfy.org>2015-01-30 13:53:45 +0100
commit954871d8ba15911d014f76ed2c7a9492953cf39d (patch)
tree7ee5e5cfccf8f3ed9feedd1c0f86481a408253c9 /src/libsystemd/sd-bus/test-bus-gvariant.c
parent82c28f5621ad80585eb6c232a988af955a07060c (diff)
Revert "sd-bus: change serialization of kdbus messages to qualify in their entirety as gvariant objects"
This breaks booting with kdbus. This reverts commit b381de4197157748ed96e469fcc372c23f842ae1.
Diffstat (limited to 'src/libsystemd/sd-bus/test-bus-gvariant.c')
-rw-r--r--src/libsystemd/sd-bus/test-bus-gvariant.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/libsystemd/sd-bus/test-bus-gvariant.c b/src/libsystemd/sd-bus/test-bus-gvariant.c
index 992edacb28..6992ec44de 100644
--- a/src/libsystemd/sd-bus/test-bus-gvariant.c
+++ b/src/libsystemd/sd-bus/test-bus-gvariant.c
@@ -132,7 +132,7 @@ static void test_bus_gvariant_get_alignment(void) {
static void test_marshal(void) {
_cleanup_bus_message_unref_ sd_bus_message *m = NULL, *n = NULL;
- _cleanup_bus_close_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_unref_ sd_bus *bus = NULL;
_cleanup_free_ void *blob;
size_t sz;
int r;
@@ -145,8 +145,6 @@ static void test_marshal(void) {
assert_se(sd_bus_message_new_method_call(bus, &m, "a.service.name", "/an/object/path/which/is/really/really/long/so/that/we/hit/the/eight/bit/boundary/by/quite/some/margin/to/test/this/stuff/that/it/really/works", "an.interface.name", "AMethodName") >= 0);
- assert_cc(sizeof(struct bus_header) == 16);
-
assert_se(sd_bus_message_append(m,
"a(usv)", 3,
4711, "first-string-parameter", "(st)", "X", (uint64_t) 1111,
@@ -164,15 +162,13 @@ static void test_marshal(void) {
g_type_init();
#endif
- v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuta{tv})"), m->header, sizeof(struct bus_header) + m->fields_size, false, NULL, NULL);
- assert_se(g_variant_is_normal_form(v));
+ v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuuua(yv))"), m->header, sizeof(struct bus_header) + BUS_MESSAGE_FIELDS_SIZE(m), false, NULL, NULL);
t = g_variant_print(v, TRUE);
printf("%s\n", t);
g_free(t);
g_variant_unref(v);
- v = g_variant_new_from_data(G_VARIANT_TYPE("(a(usv))"), m->body.data, m->user_body_size, false, NULL, NULL);
- assert_se(g_variant_is_normal_form(v));
+ v = g_variant_new_from_data(G_VARIANT_TYPE("(a(usv))"), m->body.data, BUS_MESSAGE_BODY_SIZE(m), false, NULL, NULL);
t = g_variant_print(v, TRUE);
printf("%s\n", t);
g_free(t);
@@ -184,20 +180,6 @@ static void test_marshal(void) {
assert_se(bus_message_get_blob(m, &blob, &sz) >= 0);
-#ifdef HAVE_GLIB
- {
- GVariant *v;
- char *t;
-
- v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuta{tv}v)"), blob, sz, false, NULL, NULL);
- assert_se(g_variant_is_normal_form(v));
- t = g_variant_print(v, TRUE);
- printf("%s\n", t);
- g_free(t);
- g_variant_unref(v);
- }
-#endif
-
assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, NULL, &n) >= 0);
blob = NULL;