[vala] D-Bus: Test properties
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] D-Bus: Test properties
- Date: Mon, 15 Jun 2009 08:01:08 -0400 (EDT)
commit 386d80cbc3ff7b6898ff0fc84e899e2e8339bdec
Author: Jürg Billeter <j bitron ch>
Date: Mon Jun 15 08:38:19 2009 +0200
D-Bus: Test properties
tests/dbus/basic-types.test | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/tests/dbus/basic-types.test b/tests/dbus/basic-types.test
index 9f142e9..5ae2746 100644
--- a/tests/dbus/basic-types.test
+++ b/tests/dbus/basic-types.test
@@ -4,8 +4,10 @@ Program: client
[DBus (name = "org.example.Test")]
interface Test : Object {
- public abstract int test_int (int i, out int j);
- public abstract string test_string (string s, out string t);
+ public abstract string test_property { owned get; set; }
+
+ public abstract int test_int (int i, out int j);
+ public abstract string test_string (string s, out string t);
}
void main () {
@@ -23,23 +25,29 @@ void main () {
u = test.test_string ("hello", out t);
assert (t == "world");
assert (u == "vala");
+
+ test.test_property = "hello";
+ t = test.test_property;
+ assert (t == "hello");
}
Program: server
[DBus (name = "org.example.Test")]
class Test : Object {
- public int test_int (int i, out int j) {
- assert (i == 42);
- j = 23;
- return 11;
- }
-
- public string test_string (string s, out string t) {
- assert (s == "hello");
- t = "world";
- return "vala";
- }
+ public string test_property { owned get; set; }
+
+ public int test_int (int i, out int j) {
+ assert (i == 42);
+ j = 23;
+ return 11;
+ }
+
+ public string test_string (string s, out string t) {
+ assert (s == "hello");
+ t = "world";
+ return "vala";
+ }
}
MainLoop main_loop;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]