]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Test properties
authorJürg Billeter <j@bitron.ch>
Mon, 15 Jun 2009 06:38:19 +0000 (08:38 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 15 Jun 2009 11:55:44 +0000 (13:55 +0200)
tests/dbus/basic-types.test

index 9f142e9631edab6590c4c2b74444dc172f0dce0d..5ae27468e407d77b056f3ea1e55ba45ade9c2e99 100644 (file)
@@ -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;