[vala/0.40] test: Add property lock test



commit 1395a097a5ecf1ddcc2a5d406fbad08d3763e736
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Sep 16 19:27:17 2018 +0200

    test: Add property lock test

 tests/objects/properties.vala | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/tests/objects/properties.vala b/tests/objects/properties.vala
index 1a40e95e0..9c06888c5 100644
--- a/tests/objects/properties.vala
+++ b/tests/objects/properties.vala
@@ -28,6 +28,9 @@ public class Sample : Object {
                get { return _read_only; }
        }
 
+       public int public_prop { get; set; }
+       private int private_prop { get; set; }
+
        public Sample (string name) {
                this.name = name;
        }
@@ -56,7 +59,14 @@ public class Sample : Object {
                stdout.printf("automatic: %s\n", automatic);
 
                this.deleg = null;
-        }
+
+               lock (public_prop) {
+                       public_prop = 42;
+               }
+               lock (private_prop) {
+                       private_prop = 42;
+               }
+       }
 
        public static int main () {
                var test = new Sample("InitialName");


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