From: Jürg Billeter Date: Wed, 16 Sep 2009 16:49:48 +0000 (+0200) Subject: D-Bus: Test async client and server methods with out parameters X-Git-Tag: 0.7.6~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4802d1b91ab4131638c613c4dc38de097a054ef;p=thirdparty%2Fvala.git D-Bus: Test async client and server methods with out parameters --- diff --git a/tests/dbus/async.test b/tests/dbus/async.test index 0393bb2d3..03f4e6c03 100644 --- a/tests/dbus/async.test +++ b/tests/dbus/async.test @@ -4,19 +4,21 @@ Program: client [DBus (name = "org.example.Test")] interface Test : Object { - public abstract async int test_int (int i) throws DBus.Error; - public abstract async string test_string (string s) throws DBus.Error; + public abstract async int test_int (int i, out int j) throws DBus.Error; + public abstract async string test_string (string s, out string t) throws DBus.Error; } MainLoop main_loop; async void run (Test test) { - int k; - k = yield test.test_int (42); + int j, k; + k = yield test.test_int (42, out j); + assert (j == 23); assert (k == 11); - string u; - u = yield test.test_string ("hello"); + string t, u; + u = yield test.test_string ("hello", out t); + assert (t == "world"); assert (u == "vala"); main_loop.quit (); @@ -38,17 +40,19 @@ Program: server [DBus (name = "org.example.Test")] class Test : Object { - public async int test_int (int i) { + public async int test_int (int i, out int j) { assert (i == 42); Idle.add (test_int.callback); yield; + j = 23; return 11; } - public async string test_string (string s) { + public async string test_string (string s, out string t) { assert (s == "hello"); Idle.add (test_string.callback); yield; + t = "world"; return "vala"; } }