]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add bug specific "lock test"
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 17 Nov 2018 15:10:04 +0000 (16:10 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 17 Nov 2018 16:24:21 +0000 (17:24 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=629593

tests/Makefile.am
tests/objects/bug629593.vala [new file with mode: 0644]

index 2044a7a0a8305f56bf626954c48d890e34e90a47..cf7562570d9bfa85c5c5f6c76099fc184e9e7bbe 100644 (file)
@@ -292,6 +292,7 @@ TESTS = \
        objects/bug624594.vala \
        objects/bug626038.vala \
        objects/bug628639.vala \
+       objects/bug629593.vala \
        objects/bug631267.vala \
        objects/bug634782.vala \
        objects/bug641418-1.test \
diff --git a/tests/objects/bug629593.vala b/tests/objects/bug629593.vala
new file mode 100644 (file)
index 0000000..476dc4d
--- /dev/null
@@ -0,0 +1,32 @@
+public class Foo {
+       protected int thing_to_lock_on;
+       public int other_variable;
+
+       public Foo () {
+               other_variable = 0;
+       }
+
+       public void run () {
+               lock (thing_to_lock_on) {
+                       other_variable = 1;
+               }
+       }
+}
+
+public class Bar {
+       protected class int thing_to_lock_on;
+       public int other_variable;
+
+       public Bar () {
+               other_variable = 0;
+       }
+
+       public void run () {
+               lock (thing_to_lock_on) {
+                       other_variable = 1;
+               }
+       }
+}
+
+void main () {
+}