From: Rico Tzschichholz Date: Sat, 23 Oct 2021 13:27:12 +0000 (+0200) Subject: tests: Add more invalid "(un)lock" tests to increase coverage X-Git-Tag: 0.52.7~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b3220f272e807d44596f74d36d436ca8e9b2229;p=thirdparty%2Fvala.git tests: Add more invalid "(un)lock" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 614b36a7c..b7d710301 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1046,6 +1046,8 @@ TESTS = \ semantic/localvariable-var-static-access-instance-property.test \ semantic/localvariable-var-without-initializer.test \ semantic/localvariable-void.test \ + semantic/lock-not-current-class.test \ + semantic/lock-not-lockable.test \ semantic/member-access-async-callback-invalid.test \ semantic/member-access-capture-out.test \ semantic/member-access-capture-valist-parameter.test \ @@ -1159,6 +1161,8 @@ TESTS = \ semantic/unary-unsupported-minus.test \ semantic/unary-unsupported-negation.test \ semantic/unary-unsupported-out-ref.test \ + semantic/unlock-not-current-class.test \ + semantic/unlock-not-lockable.test \ semantic/with-array.test \ semantic/with-buildin.vala \ semantic/with-class.test \ 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); +}