diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-10-23 15:27:12 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-10-23 15:27:12 +0200 |
commit | 28ef85c514bb64287c441bfc1f649589d9dde694 (patch) | |
tree | 6cba2db02dd59ddf9e7e233df883dc602f3c3a5d /tests/semantic | |
parent | 4a1fe512404de175528e533354e36b811903390d (diff) | |
download | vala-28ef85c514bb64287c441bfc1f649589d9dde694.tar.gz |
tests: Add more invalid "(un)lock" tests to increase coverage
Diffstat (limited to 'tests/semantic')
-rw-r--r-- | tests/semantic/lock-not-current-class.test | 14 | ||||
-rw-r--r-- | tests/semantic/lock-not-lockable.test | 8 | ||||
-rw-r--r-- | tests/semantic/unlock-not-current-class.test | 14 | ||||
-rw-r--r-- | tests/semantic/unlock-not-lockable.test | 8 |
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/semantic/lock-not-current-class.test b/tests/semantic/lock-not-current-class.test new file mode 100644 index 000000000..3bc6673ea --- /dev/null +++ b/tests/semantic/lock-not-current-class.test @@ -0,0 +1,14 @@ +Invalid Code + +class Bar { + public int bar; +} + +class Foo { + void foo (Bar bar) { + lock (bar.bar); + } +} + +void main () { +} diff --git a/tests/semantic/lock-not-lockable.test b/tests/semantic/lock-not-lockable.test new file mode 100644 index 000000000..d7e3a0a97 --- /dev/null +++ b/tests/semantic/lock-not-lockable.test @@ -0,0 +1,8 @@ +Invalid Code + +void foo () { +} + +void main () { + lock (foo); +} diff --git a/tests/semantic/unlock-not-current-class.test b/tests/semantic/unlock-not-current-class.test new file mode 100644 index 000000000..eae24f23c --- /dev/null +++ b/tests/semantic/unlock-not-current-class.test @@ -0,0 +1,14 @@ +Invalid Code + +class Bar { + public int bar; +} + +class Foo { + void foo (Bar bar) { + unlock (bar.bar); + } +} + +void main () { +} diff --git a/tests/semantic/unlock-not-lockable.test b/tests/semantic/unlock-not-lockable.test new file mode 100644 index 000000000..bb0a23046 --- /dev/null +++ b/tests/semantic/unlock-not-lockable.test @@ -0,0 +1,8 @@ +Invalid Code + +void foo () { +} + +void main () { + unlock (foo); +} |