summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/test-bus-kernel-bloom.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-20 00:36:50 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-20 10:13:38 +0200
commitf11e11e3446f7959c11a60eb0c9b53ed75ef9f42 (patch)
tree24a0fe412375701b8c286bca8f9719d604656b6f /src/libsystemd-bus/test-bus-kernel-bloom.c
parent86312ab8de59c1066d6d2b456f3a9106ce3e0991 (diff)
bus: add test for bloom filter prefix match
Diffstat (limited to 'src/libsystemd-bus/test-bus-kernel-bloom.c')
-rw-r--r--src/libsystemd-bus/test-bus-kernel-bloom.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd-bus/test-bus-kernel-bloom.c b/src/libsystemd-bus/test-bus-kernel-bloom.c
index 02d9a98be9..5445d3488f 100644
--- a/src/libsystemd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd-bus/test-bus-kernel-bloom.c
@@ -68,9 +68,11 @@ static void test_one(
r = sd_bus_start(b);
assert_se(r >= 0);
+ log_debug("match");
r = sd_bus_add_match(b, match, NULL, NULL);
assert_se(r >= 0);
+ log_debug("signal");
r = sd_bus_emit_signal(a, path, interface, member, "s", arg0);
assert_se(r >= 0);
@@ -95,5 +97,16 @@ int main(int argc, char *argv[]) {
test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar'", true);
test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar2'", false);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo/bar/waldo'", true);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo/bar'", false);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo'", false);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/'", false);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path='/foo/bar/waldo/quux'", false);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path_namespace='/foo/bar/waldo'", true);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path_namespace='/foo/bar'", true);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path_namespace='/foo'", true);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path_namespace='/'", true);
+ test_one("/foo/bar/waldo", "waldo.com", "Piep", "foobar", "path_namespace='/quux'", false);
+
return 0;
}