test-bus-kernel-bloom.c revision 1abe54d9a9292d746e5990843bbbc509984b7f2c
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek This file is part of systemd.
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek Copyright 2013 Lennart Poettering
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
c9d493281d321023543bf423ae10ecd821247a31Yu Watanabe the Free Software Foundation; either version 2.1 of the License, or
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek (at your option) any later version.
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
ad95fd1d2b9c6344864857c2ba7634fd87753f8eZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include "bus-message.h"
#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-util.h"
static void test_one(
const char *path,
const char *interface,
const char *member,
bool as_list,
const char *arg0,
const char *match,
bool good) {
sd_bus *a, *b;
r = sd_bus_new(&a);
assert_se(r >= 0);
r = sd_bus_new(&b);
assert_se(r >= 0);
assert_se(r >= 0);
assert_se(r >= 0);
r = sd_bus_start(a);
assert_se(r >= 0);
r = sd_bus_start(b);
assert_se(r >= 0);
assert_se(r >= 0);
if (as_list)
assert_se(r >= 0);
r = sd_bus_process(b, &m);
sd_bus_unref(a);
sd_bus_unref(b);
test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo/tuut'", false);
test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar'", true);
test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar2'", false);
test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo/quux'", false);
test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo/bar/waldo'", true);