From f8a2a0f4ace2404e14c24b12ca79ac8beb163ded Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 8 Mar 2024 19:51:50 +0000 Subject: [PATCH] tests: Add a test for matching by two well-known names The expected result is that because TEST_CONN_SERVICE owns ALREADY_OWNED_NAME but not (yet) OWNED_LATER_NAME, the signal will be delivered to the subscriber for the former but not the latter. Before #3268 was fixed, it was incorrectly delivered to both. Reproduces: https://gitlab.gnome.org/GNOME/glib/-/issues/3268 (partially) Signed-off-by: Simon McVittie --- gio/tests/gdbus-subscribe.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c index af100de7d..171d6107d 100644 --- a/gio/tests/gdbus-subscribe.c +++ b/gio/tests/gdbus-subscribe.c @@ -440,6 +440,19 @@ static const TestPlan plan_limit_by_well_known_name = .iface = EXAMPLE_INTERFACE, }, }, + { + /* When the service sends a signal with the name it already owns, + * it should get through */ + .action = TEST_ACTION_EMIT_SIGNAL, + .u.signal = { + .sender = TEST_CONN_SERVICE, + .path = EXAMPLE_PATH, + .iface = EXAMPLE_INTERFACE, + .member = FOO_SIGNAL, + .received_by_conn = 1, + .received_by_proxy = 1 + }, + }, { /* Service claims another name */ .action = TEST_ACTION_OWN_NAME,