From 71c9027d4192bf149afa4fcf9fef93bf6e901121 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Fri, 12 Dec 2014 15:14:09 +0100 Subject: sbus: add object path to sbus request Object path is heavily used in implementation of methods from interfaces that are supported on whole subtrees. Although it can be obtained from a D-Bus message, it is nice to have it accessible directly. Reviewed-by: Jakub Hrozek --- src/tests/sbus_tests.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/tests/sbus_tests.c') diff --git a/src/tests/sbus_tests.c b/src/tests/sbus_tests.c index 6086a42bf..288163d61 100644 --- a/src/tests/sbus_tests.c +++ b/src/tests/sbus_tests.c @@ -108,7 +108,6 @@ const struct sbus_interface_meta pilot_meta = { static int blink_handler(struct sbus_request *req, void *data) { DBusError error = DBUS_ERROR_INIT; - const char *path; dbus_int32_t duration = 0; dbus_bool_t crashed; @@ -116,12 +115,11 @@ static int blink_handler(struct sbus_request *req, void *data) ck_assert(data != NULL); ck_assert(data == req->intf->instance_data); - path = dbus_message_get_path(req->message); - ck_assert_str_eq(req->intf->path, path); + ck_assert_str_eq(req->intf->path, req->path); - if (strcmp(path, "/test/fry") == 0) { + if (strcmp(req->path, "/test/fry") == 0) { ck_assert_str_eq(data, "Don't crash"); - } else if (strcmp(path, "/test/leela") == 0) { + } else if (strcmp(req->path, "/test/leela") == 0) { ck_assert_str_eq(data, "Crash into the billboard"); } else { ck_abort(); -- cgit