]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Add test for calling void methods
authorJürg Billeter <j@bitron.ch>
Tue, 19 Oct 2010 08:58:10 +0000 (10:58 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 19 Oct 2010 14:35:07 +0000 (16:35 +0200)
tests/dbus/async.test
tests/dbus/basic-types.test

index 0ce9e854640048d86fdf985699dab68a8e1e90e6..7aa736317686250d915e243d775b4a7e3b86e829 100644 (file)
@@ -5,6 +5,7 @@ Program: client
 
 [DBus (name = "org.example.Test")]
 interface Test : Object {
+       public abstract async void test_void () throws IOError;
        public abstract async int test_int (int i, out int j) throws IOError;
        public abstract async string test_string (string s, out string t) throws IOError;
 }
@@ -12,6 +13,8 @@ interface Test : Object {
 MainLoop main_loop;
 
 async void run (Test test) {
+       yield test.test_void ();
+
        int j, k;
        k = yield test.test_int (42, out j);
        assert (j == 23);
@@ -39,6 +42,11 @@ Program: server
 
 [DBus (name = "org.example.Test")]
 class Test : Object {
+       public async void test_void () {
+               Idle.add (test_void.callback);
+               yield;
+       }
+
        public async int test_int (int i, out int j) {
                assert (i == 42);
                Idle.add (test_int.callback);
index 18f0d177dcefa12605d2a9e6c7b3125926737b43..e6366be5b8d309674c222acb3598335f1a12ddb2 100644 (file)
@@ -7,6 +7,7 @@ Program: client
 interface Test : Object {
        public abstract string test_property { owned get; set; }
 
+       public abstract void test_void () throws IOError;
        public abstract int test_int (int i, out int j) throws IOError;
        public abstract string test_string (string s, out string t) throws IOError;
 }
@@ -15,6 +16,8 @@ void main () {
        // client
        Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test");
 
+       test.test_void ();
+
        int j, k;
        k = test.test_int (42, out j);
        assert (j == 23);
@@ -36,6 +39,9 @@ Program: server
 class Test : Object {
        public string test_property { owned get; set; }
 
+       public void test_void () {
+       }
+
        public int test_int (int i, out int j) {
                assert (i == 42);
                j = 23;