summaryrefslogtreecommitdiff
path: root/tests/dbus
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-10-20 16:51:11 +0200
committerJürg Billeter <j@bitron.ch>2010-10-23 18:11:47 +0200
commitf815f16434555ec8f56d0b95abf2aeea786483aa (patch)
treebc36b916412d8348d0f8e2dae89c1eb4bb0d10fd /tests/dbus
parent56ef7198d010aa7c908b8e5e41c1677a7447db72 (diff)
downloadvala-f815f16434555ec8f56d0b95abf2aeea786483aa.tar.gz
D-Bus: Support Cancellable parameter in GDBus clients
Diffstat (limited to 'tests/dbus')
-rw-r--r--tests/dbus/async-errors.test14
-rw-r--r--tests/dbus/errors.test12
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/dbus/async-errors.test b/tests/dbus/async-errors.test
index c3c669f54..4c9483f5d 100644
--- a/tests/dbus/async-errors.test
+++ b/tests/dbus/async-errors.test
@@ -8,6 +8,7 @@ interface Test : Object {
public abstract async void test_void () throws Error;
public abstract async int test_int (int i, out int j) throws Error;
public abstract async string test_string (string s, out string t) throws Error;
+ public abstract async void test_cancellable (Cancellable? cancellable = null) throws Error;
}
MainLoop main_loop;
@@ -35,6 +36,14 @@ async void run () {
} catch {
}
+ try {
+ var cancellable = new Cancellable ();
+ cancellable.cancel ();
+ yield test.test_cancellable (cancellable);
+ assert_not_reached ();
+ } catch {
+ }
+
main_loop.quit ();
}
@@ -67,6 +76,11 @@ class Test : Object {
yield;
throw new IOError.FAILED ("Operation failed");
}
+
+ public async void test_cancellable (Cancellable? cancellable = null) throws Error {
+ Idle.add (test_cancellable.callback);
+ yield;
+ }
}
MainLoop main_loop;
diff --git a/tests/dbus/errors.test b/tests/dbus/errors.test
index 826aeb371..9088fb4fd 100644
--- a/tests/dbus/errors.test
+++ b/tests/dbus/errors.test
@@ -8,6 +8,7 @@ interface Test : Object {
public abstract void test_void () throws Error;
public abstract int test_int (int i, out int j) throws Error;
public abstract string test_string (string s, out string t) throws Error;
+ public abstract void test_cancellable (Cancellable? cancellable = null) throws Error;
}
void main () {
@@ -35,6 +36,14 @@ void main () {
assert_not_reached ();
} catch {
}
+
+ try {
+ var cancellable = new Cancellable ();
+ cancellable.cancel ();
+ test.test_cancellable (cancellable);
+ assert_not_reached ();
+ } catch {
+ }
}
Program: server
@@ -52,6 +61,9 @@ class Test : Object {
public string test_string (string s, out string t) throws Error {
throw new IOError.FAILED ("Operation failed");
}
+
+ public void test_cancellable (Cancellable? cancellable = null) throws Error {
+ }
}
MainLoop main_loop;