]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
test: Add some "method-call" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 26 Nov 2019 13:31:20 +0000 (14:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 27 Nov 2019 12:53:10 +0000 (13:53 +0100)
tests/Makefile.am
tests/semantic/methodcall-field-initializer-throws.test [new file with mode: 0644]
tests/semantic/methodcall-void-expression.test [new file with mode: 0644]
tests/semantic/methodcall-yield-with-begin.test [new file with mode: 0644]
tests/semantic/objectcreation-field-initializer-throws.test [new file with mode: 0644]

index 8448e1002bf2570028af0035fd08877e842081d7..db87cf3fea24dc96aecd334c86b91ec3dab49122 100644 (file)
@@ -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 (file)
index 0000000..8959301
--- /dev/null
@@ -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 (file)
index 0000000..f03499b
--- /dev/null
@@ -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 (file)
index 0000000..d29ec91
--- /dev/null
@@ -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 (file)
index 0000000..4432003
--- /dev/null
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Bar {
+       Foo bar = new Foo ();
+}
+
+class Foo {
+       public Foo () throws Error {
+       }
+}
+
+void main () {
+}