]>
Commit | Line | Data |
---|---|---|
de1c301e LP |
1 | /*** |
2 | This file is part of systemd. | |
3 | ||
4 | Copyright 2013 Lennart Poettering | |
5 | ||
6 | systemd is free software; you can redistribute it and/or modify it | |
7 | under the terms of the GNU Lesser General Public License as published by | |
8 | the Free Software Foundation; either version 2.1 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | systemd is distributed in the hope that it will be useful, but | |
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | Lesser General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU Lesser General Public License | |
17 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
18 | ***/ | |
19 | ||
6cd37a5e | 20 | #include <math.h> |
cf0fbc49 | 21 | #include <stdlib.h> |
de1c301e | 22 | |
349cc4a5 | 23 | #if HAVE_GLIB |
de1c301e LP |
24 | #include <gio/gio.h> |
25 | #endif | |
26 | ||
349cc4a5 | 27 | #if HAVE_DBUS |
718db961 | 28 | #include <dbus/dbus.h> |
22703094 | 29 | #endif |
de1c301e | 30 | |
de1c301e | 31 | #include "sd-bus.h" |
07630cea | 32 | |
b5efdb8a | 33 | #include "alloc-util.h" |
2b5c5383 | 34 | #include "bus-dump.h" |
a6278b88 | 35 | #include "bus-label.h" |
07630cea LP |
36 | #include "bus-message.h" |
37 | #include "bus-util.h" | |
3ffd4af2 | 38 | #include "fd-util.h" |
e4e73a63 | 39 | #include "hexdecoct.h" |
cf0fbc49 | 40 | #include "log.h" |
07630cea | 41 | #include "util.h" |
a6278b88 | 42 | |
98a4c30b DH |
43 | static void test_bus_path_encode_unique(void) { |
44 | _cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL; | |
45 | ||
46 | assert_se(bus_path_encode_unique(NULL, "/foo/bar", "some.sender", "a.suffix", &a) >= 0 && streq_ptr(a, "/foo/bar/some_2esender/a_2esuffix")); | |
47 | assert_se(bus_path_decode_unique(a, "/foo/bar", &b, &c) > 0 && streq_ptr(b, "some.sender") && streq_ptr(c, "a.suffix")); | |
48 | assert_se(bus_path_decode_unique(a, "/bar/foo", &d, &d) == 0 && !d); | |
49 | assert_se(bus_path_decode_unique("/foo/bar/onlyOneSuffix", "/foo/bar", &d, &d) == 0 && !d); | |
50 | assert_se(bus_path_decode_unique("/foo/bar/_/_", "/foo/bar", &d, &e) > 0 && streq_ptr(d, "") && streq_ptr(e, "")); | |
51 | } | |
52 | ||
a6278b88 LP |
53 | static void test_bus_path_encode(void) { |
54 | _cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL, *f = NULL; | |
55 | ||
56 | assert_se(sd_bus_path_encode("/foo/bar", "waldo", &a) >= 0 && streq(a, "/foo/bar/waldo")); | |
57 | assert_se(sd_bus_path_decode(a, "/waldo", &b) == 0 && b == NULL); | |
58 | assert_se(sd_bus_path_decode(a, "/foo/bar", &b) > 0 && streq(b, "waldo")); | |
59 | ||
60 | assert_se(sd_bus_path_encode("xxxx", "waldo", &c) < 0); | |
61 | assert_se(sd_bus_path_encode("/foo/", "waldo", &c) < 0); | |
62 | ||
63 | assert_se(sd_bus_path_encode("/foo/bar", "", &c) >= 0 && streq(c, "/foo/bar/_")); | |
64 | assert_se(sd_bus_path_decode(c, "/foo/bar", &d) > 0 && streq(d, "")); | |
65 | ||
66 | assert_se(sd_bus_path_encode("/foo/bar", "foo.bar", &e) >= 0 && streq(e, "/foo/bar/foo_2ebar")); | |
67 | assert_se(sd_bus_path_decode(e, "/foo/bar", &f) > 0 && streq(f, "foo.bar")); | |
68 | } | |
de1c301e | 69 | |
dfb815c3 DH |
70 | static void test_bus_path_encode_many(void) { |
71 | _cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL, *f = NULL; | |
72 | ||
73 | assert_se(sd_bus_path_decode_many("/foo/bar", "/prefix/%", NULL) == 0); | |
74 | assert_se(sd_bus_path_decode_many("/prefix/bar", "/prefix/%bar", NULL) == 1); | |
75 | assert_se(sd_bus_path_decode_many("/foo/bar", "/prefix/%/suffix", NULL) == 0); | |
76 | assert_se(sd_bus_path_decode_many("/prefix/foobar/suffix", "/prefix/%/suffix", &a) == 1 && streq_ptr(a, "foobar")); | |
77 | assert_se(sd_bus_path_decode_many("/prefix/one_foo_two/mid/three_bar_four/suffix", "/prefix/one_%_two/mid/three_%_four/suffix", &b, &c) == 1 && streq_ptr(b, "foo") && streq_ptr(c, "bar")); | |
78 | assert_se(sd_bus_path_decode_many("/prefix/one_foo_two/mid/three_bar_four/suffix", "/prefix/one_%_two/mid/three_%_four/suffix", NULL, &d) == 1 && streq_ptr(d, "bar")); | |
79 | ||
80 | assert_se(sd_bus_path_decode_many("/foo/bar", "/foo/bar/%", NULL) == 0); | |
81 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/bar%", NULL) == 0); | |
82 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%/bar", NULL) == 0); | |
83 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%bar", NULL) == 0); | |
84 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/bar/suffix") == 1); | |
85 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%%/suffix", NULL, NULL) == 0); /* multiple '%' are treated verbatim */ | |
86 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%/suffi", NULL) == 0); | |
87 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%/suffix", &e) == 1 && streq_ptr(e, "bar")); | |
88 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/foo/%/%", NULL, NULL) == 1); | |
89 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/%/%/%", NULL, NULL, NULL) == 1); | |
90 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "%/%/%", NULL, NULL, NULL) == 0); | |
91 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/%/%", NULL, NULL) == 0); | |
92 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/%/%/", NULL, NULL) == 0); | |
93 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/%/", NULL) == 0); | |
94 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "/%", NULL) == 0); | |
95 | assert_se(sd_bus_path_decode_many("/foo/bar/suffix", "%", NULL) == 0); | |
96 | ||
97 | assert_se(sd_bus_path_encode_many(&f, "/prefix/one_%_two/mid/three_%_four/suffix", "foo", "bar") >= 0 && streq_ptr(f, "/prefix/one_foo_two/mid/three_bar_four/suffix")); | |
98 | } | |
99 | ||
28383ba1 LP |
100 | static void test_bus_label_escape_one(const char *a, const char *b) { |
101 | _cleanup_free_ char *t = NULL, *x = NULL, *y = NULL; | |
102 | ||
a6278b88 | 103 | assert_se(t = bus_label_escape(a)); |
28383ba1 LP |
104 | assert_se(streq(t, b)); |
105 | ||
a6278b88 | 106 | assert_se(x = bus_label_unescape(t)); |
28383ba1 LP |
107 | assert_se(streq(a, x)); |
108 | ||
a6278b88 | 109 | assert_se(y = bus_label_unescape(b)); |
28383ba1 LP |
110 | assert_se(streq(a, y)); |
111 | } | |
112 | ||
113 | static void test_bus_label_escape(void) { | |
114 | test_bus_label_escape_one("foo123bar", "foo123bar"); | |
115 | test_bus_label_escape_one("foo.bar", "foo_2ebar"); | |
116 | test_bus_label_escape_one("foo_2ebar", "foo_5f2ebar"); | |
117 | test_bus_label_escape_one("", "_"); | |
118 | test_bus_label_escape_one("_", "_5f"); | |
119 | test_bus_label_escape_one("1", "_31"); | |
120 | test_bus_label_escape_one(":1", "_3a1"); | |
121 | } | |
122 | ||
de1c301e | 123 | int main(int argc, char *argv[]) { |
4afd3348 | 124 | _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL, *copy = NULL; |
9a17484d | 125 | int r, boolean; |
d44fdf49 | 126 | const char *x, *x2, *y, *z, *a, *b, *c, *d, *a_signature; |
de1c301e LP |
127 | uint8_t u, v; |
128 | void *buffer = NULL; | |
129 | size_t sz; | |
130 | char *h; | |
b3af9646 | 131 | const int32_t integer_array[] = { -1, -2, 0, 1, 2 }, *return_array; |
f8e013f8 | 132 | char *s; |
c430fee6 LP |
133 | _cleanup_free_ char *first = NULL, *second = NULL, *third = NULL; |
134 | _cleanup_fclose_ FILE *ms = NULL; | |
135 | size_t first_size = 0, second_size = 0, third_size = 0; | |
4afd3348 | 136 | _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; |
6cd37a5e LP |
137 | double dbl; |
138 | uint64_t u64; | |
de1c301e | 139 | |
6349cda2 | 140 | r = sd_bus_default_user(&bus); |
2a0958d2 LP |
141 | if (r < 0) |
142 | return EXIT_TEST_SKIP; | |
143 | ||
144 | r = sd_bus_message_new_method_call(bus, &m, "foobar.waldo", "/", "foobar.waldo", "Piep"); | |
de1c301e LP |
145 | assert_se(r >= 0); |
146 | ||
effbc8e4 ZJS |
147 | r = sd_bus_message_append(m, ""); |
148 | assert_se(r >= 0); | |
149 | ||
de1c301e LP |
150 | r = sd_bus_message_append(m, "s", "a string"); |
151 | assert_se(r >= 0); | |
152 | ||
b8beb278 | 153 | r = sd_bus_message_append(m, "s", NULL); |
15912917 | 154 | assert_se(r >= 0); |
b8beb278 | 155 | |
d44fdf49 | 156 | r = sd_bus_message_append(m, "asg", 2, "string #1", "string #2", "sba(tt)ss"); |
de1c301e LP |
157 | assert_se(r >= 0); |
158 | ||
159 | r = sd_bus_message_append(m, "sass", "foobar", 5, "foo", "bar", "waldo", "piep", "pap", "after"); | |
160 | assert_se(r >= 0); | |
161 | ||
162 | r = sd_bus_message_append(m, "a{yv}", 2, 3, "s", "foo", 5, "s", "waldo"); | |
163 | assert_se(r >= 0); | |
164 | ||
4f1d7741 | 165 | r = sd_bus_message_append(m, "y(ty)y(yt)y", 8, 777ULL, 7, 9, 77, 7777ULL, 10); |
443a5598 DH |
166 | assert_se(r >= 0); |
167 | ||
a388569f DH |
168 | r = sd_bus_message_append(m, "()"); |
169 | assert_se(r >= 0); | |
170 | ||
de1c301e LP |
171 | r = sd_bus_message_append(m, "ba(ss)", 255, 3, "aaa", "1", "bbb", "2", "ccc", "3"); |
172 | assert_se(r >= 0); | |
173 | ||
174 | r = sd_bus_message_open_container(m, 'a', "s"); | |
175 | assert_se(r >= 0); | |
176 | ||
177 | r = sd_bus_message_append_basic(m, 's', "foobar"); | |
178 | assert_se(r >= 0); | |
179 | ||
180 | r = sd_bus_message_append_basic(m, 's', "waldo"); | |
181 | assert_se(r >= 0); | |
182 | ||
183 | r = sd_bus_message_close_container(m); | |
184 | assert_se(r >= 0); | |
185 | ||
f8e013f8 LP |
186 | r = sd_bus_message_append_string_space(m, 5, &s); |
187 | assert_se(r >= 0); | |
188 | strcpy(s, "hallo"); | |
189 | ||
b3af9646 LP |
190 | r = sd_bus_message_append_array(m, 'i', integer_array, sizeof(integer_array)); |
191 | assert_se(r >= 0); | |
192 | ||
5e86fd7b LP |
193 | r = sd_bus_message_append_array(m, 'u', NULL, 0); |
194 | assert_se(r >= 0); | |
195 | ||
6cd37a5e LP |
196 | r = sd_bus_message_append(m, "a(stdo)", 1, "foo", 815ULL, 47.0, "/"); |
197 | assert_se(r >= 0); | |
198 | ||
3df7a7e6 | 199 | r = bus_message_seal(m, 4711, 0); |
de1c301e LP |
200 | assert_se(r >= 0); |
201 | ||
d55192ad | 202 | bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER); |
c430fee6 LP |
203 | |
204 | ms = open_memstream(&first, &first_size); | |
d55192ad | 205 | bus_message_dump(m, ms, 0); |
c430fee6 LP |
206 | fflush(ms); |
207 | assert_se(!ferror(ms)); | |
de1c301e LP |
208 | |
209 | r = bus_message_get_blob(m, &buffer, &sz); | |
210 | assert_se(r >= 0); | |
211 | ||
212 | h = hexmem(buffer, sz); | |
213 | assert_se(h); | |
214 | ||
de0671ee | 215 | log_info("message size = %zu, contents =\n%s", sz, h); |
de1c301e LP |
216 | free(h); |
217 | ||
349cc4a5 | 218 | #if HAVE_GLIB |
de1c301e LP |
219 | { |
220 | GDBusMessage *g; | |
221 | char *p; | |
222 | ||
34f856cb | 223 | #if !defined(GLIB_VERSION_2_36) |
de1c301e | 224 | g_type_init(); |
34f856cb | 225 | #endif |
de1c301e LP |
226 | |
227 | g = g_dbus_message_new_from_blob(buffer, sz, 0, NULL); | |
228 | p = g_dbus_message_print(g, 0); | |
229 | log_info("%s", p); | |
230 | g_free(p); | |
231 | g_object_unref(g); | |
232 | } | |
233 | #endif | |
234 | ||
349cc4a5 | 235 | #if HAVE_DBUS |
de1c301e LP |
236 | { |
237 | DBusMessage *w; | |
238 | DBusError error; | |
239 | ||
240 | dbus_error_init(&error); | |
241 | ||
242 | w = dbus_message_demarshal(buffer, sz, &error); | |
c1b9d935 | 243 | if (!w) |
de1c301e | 244 | log_error("%s", error.message); |
c1b9d935 | 245 | else |
de1c301e | 246 | dbus_message_unref(w); |
49df985c EV |
247 | |
248 | dbus_error_free(&error); | |
de1c301e | 249 | } |
22703094 | 250 | #endif |
de1c301e | 251 | |
80a46c73 LP |
252 | m = sd_bus_message_unref(m); |
253 | ||
aa0d0ed6 | 254 | r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, &m); |
80a46c73 LP |
255 | assert_se(r >= 0); |
256 | ||
d55192ad | 257 | bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER); |
c430fee6 LP |
258 | |
259 | fclose(ms); | |
260 | ms = open_memstream(&second, &second_size); | |
d55192ad | 261 | bus_message_dump(m, ms, 0); |
c430fee6 LP |
262 | fflush(ms); |
263 | assert_se(!ferror(ms)); | |
264 | assert_se(first_size == second_size); | |
265 | assert_se(memcmp(first, second, first_size) == 0); | |
de1c301e | 266 | |
9a17484d LP |
267 | assert_se(sd_bus_message_rewind(m, true) >= 0); |
268 | ||
d44fdf49 | 269 | r = sd_bus_message_read(m, "ssasg", &x, &x2, 2, &y, &z, &a_signature); |
9a17484d LP |
270 | assert_se(r > 0); |
271 | assert_se(streq(x, "a string")); | |
15912917 | 272 | assert_se(streq(x2, "")); |
9a17484d LP |
273 | assert_se(streq(y, "string #1")); |
274 | assert_se(streq(z, "string #2")); | |
d44fdf49 | 275 | assert_se(streq(a_signature, "sba(tt)ss")); |
9a17484d LP |
276 | |
277 | r = sd_bus_message_read(m, "sass", &x, 5, &y, &z, &a, &b, &c, &d); | |
278 | assert_se(r > 0); | |
279 | assert_se(streq(x, "foobar")); | |
280 | assert_se(streq(y, "foo")); | |
281 | assert_se(streq(z, "bar")); | |
282 | assert_se(streq(a, "waldo")); | |
283 | assert_se(streq(b, "piep")); | |
284 | assert_se(streq(c, "pap")); | |
285 | assert_se(streq(d, "after")); | |
286 | ||
287 | r = sd_bus_message_read(m, "a{yv}", 2, &u, "s", &x, &v, "s", &y); | |
288 | assert_se(r > 0); | |
289 | assert_se(u == 3); | |
290 | assert_se(streq(x, "foo")); | |
291 | assert_se(v == 5); | |
292 | assert_se(streq(y, "waldo")); | |
293 | ||
443a5598 DH |
294 | r = sd_bus_message_read(m, "y(ty)", &v, &u64, &u); |
295 | assert_se(r > 0); | |
296 | assert_se(v == 8); | |
297 | assert_se(u64 == 777); | |
298 | assert_se(u == 7); | |
299 | ||
300 | r = sd_bus_message_read(m, "y(yt)", &v, &u, &u64); | |
301 | assert_se(r > 0); | |
302 | assert_se(v == 9); | |
303 | assert_se(u == 77); | |
304 | assert_se(u64 == 7777); | |
305 | ||
306 | r = sd_bus_message_read(m, "y", &v); | |
307 | assert_se(r > 0); | |
308 | assert_se(v == 10); | |
309 | ||
a388569f DH |
310 | r = sd_bus_message_read(m, "()"); |
311 | assert_se(r > 0); | |
312 | ||
9a17484d LP |
313 | r = sd_bus_message_read(m, "ba(ss)", &boolean, 3, &x, &y, &a, &b, &c, &d); |
314 | assert_se(r > 0); | |
315 | assert_se(boolean); | |
316 | assert_se(streq(x, "aaa")); | |
317 | assert_se(streq(y, "1")); | |
318 | assert_se(streq(a, "bbb")); | |
319 | assert_se(streq(b, "2")); | |
320 | assert_se(streq(c, "ccc")); | |
321 | assert_se(streq(d, "3")); | |
322 | ||
c430fee6 LP |
323 | assert_se(sd_bus_message_verify_type(m, 'a', "s") > 0); |
324 | ||
9a17484d LP |
325 | r = sd_bus_message_read(m, "as", 2, &x, &y); |
326 | assert_se(r > 0); | |
327 | assert_se(streq(x, "foobar")); | |
328 | assert_se(streq(y, "waldo")); | |
329 | ||
f8e013f8 LP |
330 | r = sd_bus_message_read_basic(m, 's', &s); |
331 | assert_se(r > 0); | |
332 | assert_se(streq(s, "hallo")); | |
333 | ||
b3af9646 LP |
334 | r = sd_bus_message_read_array(m, 'i', (const void**) &return_array, &sz); |
335 | assert_se(r > 0); | |
336 | assert_se(sz == sizeof(integer_array)); | |
337 | assert_se(memcmp(integer_array, return_array, sz) == 0); | |
338 | ||
5e86fd7b LP |
339 | r = sd_bus_message_read_array(m, 'u', (const void**) &return_array, &sz); |
340 | assert_se(r > 0); | |
341 | assert_se(sz == 0); | |
342 | ||
6cd37a5e LP |
343 | r = sd_bus_message_read(m, "a(stdo)", 1, &x, &u64, &dbl, &y); |
344 | assert_se(r > 0); | |
345 | assert_se(streq(x, "foo")); | |
346 | assert_se(u64 == 815ULL); | |
347 | assert_se(fabs(dbl - 47.0) < 0.1); | |
348 | assert_se(streq(y, "/")); | |
349 | ||
9a17484d LP |
350 | r = sd_bus_message_peek_type(m, NULL, NULL); |
351 | assert_se(r == 0); | |
de1c301e | 352 | |
2a0958d2 | 353 | r = sd_bus_message_new_method_call(bus, ©, "foobar.waldo", "/", "foobar.waldo", "Piep"); |
c430fee6 LP |
354 | assert_se(r >= 0); |
355 | ||
356 | r = sd_bus_message_rewind(m, true); | |
357 | assert_se(r >= 0); | |
358 | ||
359 | r = sd_bus_message_copy(copy, m, true); | |
360 | assert_se(r >= 0); | |
361 | ||
3df7a7e6 | 362 | r = bus_message_seal(copy, 4712, 0); |
c430fee6 LP |
363 | assert_se(r >= 0); |
364 | ||
365 | fclose(ms); | |
366 | ms = open_memstream(&third, &third_size); | |
d55192ad | 367 | bus_message_dump(copy, ms, 0); |
c430fee6 LP |
368 | fflush(ms); |
369 | assert_se(!ferror(ms)); | |
370 | ||
9b55cd56 ZJS |
371 | printf("<%.*s>\n", (int) first_size, first); |
372 | printf("<%.*s>\n", (int) third_size, third); | |
c430fee6 LP |
373 | |
374 | assert_se(first_size == third_size); | |
375 | assert_se(memcmp(first, third, third_size) == 0); | |
376 | ||
9b07511d LP |
377 | r = sd_bus_message_rewind(m, true); |
378 | assert_se(r >= 0); | |
379 | ||
380 | assert_se(sd_bus_message_verify_type(m, 's', NULL) > 0); | |
381 | ||
d44fdf49 | 382 | r = sd_bus_message_skip(m, "ssasg"); |
9b07511d LP |
383 | assert_se(r > 0); |
384 | ||
385 | assert_se(sd_bus_message_verify_type(m, 's', NULL) > 0); | |
386 | ||
387 | r = sd_bus_message_skip(m, "sass"); | |
388 | assert_se(r >= 0); | |
389 | ||
390 | assert_se(sd_bus_message_verify_type(m, 'a', "{yv}") > 0); | |
391 | ||
a388569f | 392 | r = sd_bus_message_skip(m, "a{yv}y(ty)y(yt)y()"); |
9b07511d LP |
393 | assert_se(r >= 0); |
394 | ||
395 | assert_se(sd_bus_message_verify_type(m, 'b', NULL) > 0); | |
396 | ||
275b39fe | 397 | r = sd_bus_message_read(m, "b", &boolean); |
9b07511d LP |
398 | assert_se(r > 0); |
399 | assert_se(boolean); | |
275b39fe LP |
400 | |
401 | r = sd_bus_message_enter_container(m, 0, NULL); | |
402 | assert_se(r > 0); | |
403 | ||
404 | r = sd_bus_message_read(m, "(ss)", &x, &y); | |
405 | assert_se(r > 0); | |
406 | ||
407 | r = sd_bus_message_read(m, "(ss)", &a, &b); | |
408 | assert_se(r > 0); | |
409 | ||
410 | r = sd_bus_message_read(m, "(ss)", &c, &d); | |
411 | assert_se(r > 0); | |
412 | ||
413 | r = sd_bus_message_read(m, "(ss)", &x, &y); | |
414 | assert_se(r == 0); | |
415 | ||
416 | r = sd_bus_message_exit_container(m); | |
417 | assert_se(r >= 0); | |
418 | ||
9b07511d LP |
419 | assert_se(streq(x, "aaa")); |
420 | assert_se(streq(y, "1")); | |
421 | assert_se(streq(a, "bbb")); | |
422 | assert_se(streq(b, "2")); | |
423 | assert_se(streq(c, "ccc")); | |
424 | assert_se(streq(d, "3")); | |
425 | ||
28383ba1 | 426 | test_bus_label_escape(); |
a6278b88 | 427 | test_bus_path_encode(); |
98a4c30b | 428 | test_bus_path_encode_unique(); |
dfb815c3 | 429 | test_bus_path_encode_many(); |
28383ba1 | 430 | |
de1c301e LP |
431 | return 0; |
432 | } |