[vala] D-Bus: Add test for calling void methods



commit 5333b61720a8d648db36c5821dc1fdd905f67c2b
Author: Jürg Billeter <j bitron ch>
Date:   Tue Oct 19 10:58:10 2010 +0200

    D-Bus: Add test for calling void methods

 tests/dbus/async.test       |    8 ++++++++
 tests/dbus/basic-types.test |    6 ++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/tests/dbus/async.test b/tests/dbus/async.test
index 0ce9e85..7aa7363 100644
--- a/tests/dbus/async.test
+++ b/tests/dbus/async.test
@@ -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);
diff --git a/tests/dbus/basic-types.test b/tests/dbus/basic-types.test
index 18f0d17..e6366be 100644
--- a/tests/dbus/basic-types.test
+++ b/tests/dbus/basic-types.test
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]