From 49ae76e5db30cbcb0c7b3019507d8dc4e756842c Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sat, 17 Nov 2018 16:10:04 +0100 Subject: [PATCH] tests: Add bug specific "lock test" https://bugzilla.gnome.org/show_bug.cgi?id=629593 --- tests/Makefile.am | 1 + tests/objects/bug629593.vala | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/objects/bug629593.vala diff --git a/tests/Makefile.am b/tests/Makefile.am index 4e761d793..4fbb9b213 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -290,6 +290,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 index 000000000..476dc4d32 --- /dev/null +++ b/tests/objects/bug629593.vala @@ -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 () { +} -- 2.47.2