summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-11-26 14:31:20 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-11-27 13:53:10 +0100
commitfa5175458874e89b2addb08c3a78911e9f42f39e (patch)
tree4adb7a677fa7660e69e129eb032ab6e4d4666f81
parent6acc2140a29d636c73cd1d03f025dde32c8dc819 (diff)
downloadvala-fa5175458874e89b2addb08c3a78911e9f42f39e.tar.gz
test: Add some "method-call" tests to increase coverage
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/semantic/methodcall-field-initializer-throws.test12
-rw-r--r--tests/semantic/methodcall-void-expression.test8
-rw-r--r--tests/semantic/methodcall-yield-with-begin.test11
-rw-r--r--tests/semantic/objectcreation-field-initializer-throws.test13
5 files changed, 48 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8448e1002..db87cf3fe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -784,7 +784,11 @@ TESTS = \
semantic/method-too-many-type-arguments.test \
semantic/method-virtual.test \
semantic/method-virtual-body.test \
+ semantic/methodcall-field-initializer-throws.test \
+ semantic/methodcall-void-expression.test \
+ semantic/methodcall-yield-with-begin.test \
semantic/objectcreation-abstract-class.test \
+ semantic/objectcreation-field-initializer-throws.test \
semantic/objectcreation-no-creation-method.test \
semantic/objectcreation-non-public-constructor.test \
semantic/objectcreation-unsupported-type.test \
diff --git a/tests/semantic/methodcall-field-initializer-throws.test b/tests/semantic/methodcall-field-initializer-throws.test
new file mode 100644
index 000000000..8959301ac
--- /dev/null
+++ b/tests/semantic/methodcall-field-initializer-throws.test
@@ -0,0 +1,12 @@
+Invalid Code
+
+class Bar {
+ int bar = foo ();
+}
+
+int foo () throws Error {
+ return 42;
+}
+
+void main () {
+}
diff --git a/tests/semantic/methodcall-void-expression.test b/tests/semantic/methodcall-void-expression.test
new file mode 100644
index 000000000..f03499bee
--- /dev/null
+++ b/tests/semantic/methodcall-void-expression.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+void foo () {
+}
+
+void main () {
+ void* f = foo ();
+}
diff --git a/tests/semantic/methodcall-yield-with-begin.test b/tests/semantic/methodcall-yield-with-begin.test
new file mode 100644
index 000000000..d29ec9176
--- /dev/null
+++ b/tests/semantic/methodcall-yield-with-begin.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+async void foo () {
+}
+
+async void bar () {
+ yield foo.begin ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/objectcreation-field-initializer-throws.test b/tests/semantic/objectcreation-field-initializer-throws.test
new file mode 100644
index 000000000..4432003de
--- /dev/null
+++ b/tests/semantic/objectcreation-field-initializer-throws.test
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Bar {
+ Foo bar = new Foo ();
+}
+
+class Foo {
+ public Foo () throws Error {
+ }
+}
+
+void main () {
+}