summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-04-07 16:30:41 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-04-07 16:30:41 +0100
commit2dafaac83991078ed206ad359dda037e492e80df (patch)
tree04ae0c9c98b629446176fd198ab040f048a0d079 /bus
parentb92f2224bfd3e03cc935651f9d0464e8e08e26e7 (diff)
Check parsing (or otherwise) of path_namespace in match rules
Diffstat (limited to 'bus')
-rw-r--r--bus/signals.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/bus/signals.c b/bus/signals.c
index d7bddca3..4d34ca14 100644
--- a/bus/signals.c
+++ b/bus/signals.c
@@ -2255,6 +2255,24 @@ test_parsing (void *data)
rule = check_parse (FALSE, "type='signal',type='method_call'");
_dbus_assert (rule == NULL);
+ rule = check_parse (TRUE, "path_namespace='/foo/bar'");
+ if (rule != NULL)
+ {
+ _dbus_assert (rule->flags == BUS_MATCH_PATH_NAMESPACE);
+ _dbus_assert (rule->path != NULL);
+ _dbus_assert (strcmp (rule->path, "/foo/bar") == 0);
+
+ bus_match_rule_unref (rule);
+ }
+
+ /* Almost a duplicate */
+ rule = check_parse (FALSE, "path='/foo',path_namespace='/foo'");
+ _dbus_assert (rule == NULL);
+
+ /* Trailing / was supported in the initial proposal, but now isn't */
+ rule = check_parse (FALSE, "path_namespace='/foo/'");
+ _dbus_assert (rule == NULL);
+
/* Duplicates with the argN code */
rule = check_parse (FALSE, "arg0='foo',arg0='bar'");
_dbus_assert (rule == NULL);