summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-02-05 16:19:56 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-02-05 16:19:56 +0100
commitb03d7515ac261c85f5f6126cd6500087be0ee5ea (patch)
tree11c90a2550fdea7de4754630e4ba7eb6b5217e57
parent78c37a77eeea95526305c7907a379f86de958810 (diff)
downloadvala-b03d7515ac261c85f5f6126cd6500087be0ee5ea.tar.gz
tests: Add invalid "method" tests to increase coverage
-rw-r--r--tests/Makefile.am23
-rw-r--r--tests/semantic/method-abstract-body.test9
-rw-r--r--tests/semantic/method-abstract.test8
-rw-r--r--tests/semantic/method-async-ref-parameter.test8
-rw-r--r--tests/semantic/method-body.test6
-rw-r--r--tests/semantic/method-class-abstract.test8
-rw-r--r--tests/semantic/method-derived-compact.test13
-rw-r--r--tests/semantic/method-error-accessibility.test11
-rw-r--r--tests/semantic/method-extern-abstract.test8
-rw-r--r--tests/semantic/method-extern-body.test7
-rw-r--r--tests/semantic/method-extern-virtual.test8
-rw-r--r--tests/semantic/method-main-async.test5
-rw-r--r--tests/semantic/method-main-inline.test4
-rw-r--r--tests/semantic/method-main-throws.test8
-rw-r--r--tests/semantic/method-override.test7
-rw-r--r--tests/semantic/method-postcondition.test7
-rw-r--r--tests/semantic/method-precondition.test7
-rw-r--r--tests/semantic/method-private-abstract.test8
-rw-r--r--tests/semantic/method-private-override.test14
-rw-r--r--tests/semantic/method-private-virtual.test9
-rw-r--r--tests/semantic/method-protected.test7
-rw-r--r--tests/semantic/method-return-accessibility.test10
-rw-r--r--tests/semantic/method-virtual-body.test6
-rw-r--r--tests/semantic/method-virtual.test7
24 files changed, 208 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a496d85d4..936d141f3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -431,6 +431,29 @@ TESTS = \
semantic/field-namespace-owned.test \
semantic/field-non-constant.test \
semantic/field-void.test \
+ semantic/method-abstract.test \
+ semantic/method-abstract-body.test \
+ semantic/method-async-ref-parameter.test \
+ semantic/method-body.test \
+ semantic/method-class-abstract.test \
+ semantic/method-derived-compact.test \
+ semantic/method-error-accessibility.test \
+ semantic/method-extern-abstract.test \
+ semantic/method-extern-body.test \
+ semantic/method-extern-virtual.test \
+ semantic/method-main-async.test \
+ semantic/method-main-inline.test \
+ semantic/method-main-throws.test \
+ semantic/method-override.test \
+ semantic/method-postcondition.test \
+ semantic/method-precondition.test \
+ semantic/method-private-abstract.test \
+ semantic/method-private-override.test \
+ semantic/method-private-virtual.test \
+ semantic/method-protected.test \
+ semantic/method-return-accessibility.test \
+ semantic/method-virtual.test \
+ semantic/method-virtual-body.test \
semantic/parameter-accessibility.test \
semantic/parameter-default-type.test \
semantic/parameter-out-default.test \
diff --git a/tests/semantic/method-abstract-body.test b/tests/semantic/method-abstract-body.test
new file mode 100644
index 000000000..bfbf097f6
--- /dev/null
+++ b/tests/semantic/method-abstract-body.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+abstract class Foo {
+ public abstract void foo () {
+ }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-abstract.test b/tests/semantic/method-abstract.test
new file mode 100644
index 000000000..fe8f7ae83
--- /dev/null
+++ b/tests/semantic/method-abstract.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+struct Foo {
+ public abstract void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-async-ref-parameter.test b/tests/semantic/method-async-ref-parameter.test
new file mode 100644
index 000000000..47a8a938d
--- /dev/null
+++ b/tests/semantic/method-async-ref-parameter.test
@@ -0,0 +1,8 @@
+Packages: gio-2.0
+Invalid Code
+
+async void foo (ref int i) {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-body.test b/tests/semantic/method-body.test
new file mode 100644
index 000000000..47a376360
--- /dev/null
+++ b/tests/semantic/method-body.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+void foo ();
+
+void main () {
+}
diff --git a/tests/semantic/method-class-abstract.test b/tests/semantic/method-class-abstract.test
new file mode 100644
index 000000000..08df0e7e1
--- /dev/null
+++ b/tests/semantic/method-class-abstract.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+class Foo {
+ public abstract void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-derived-compact.test b/tests/semantic/method-derived-compact.test
new file mode 100644
index 000000000..ac257a9f9
--- /dev/null
+++ b/tests/semantic/method-derived-compact.test
@@ -0,0 +1,13 @@
+Invalid Code
+
+[Compact]
+class Foo {
+}
+
+class Bar : Foo {
+ public virtual void foo () {
+ }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-error-accessibility.test b/tests/semantic/method-error-accessibility.test
new file mode 100644
index 000000000..f150aa84b
--- /dev/null
+++ b/tests/semantic/method-error-accessibility.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+errordomain FooError {
+ BAR
+}
+
+public void foo () throws FooError {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-extern-abstract.test b/tests/semantic/method-extern-abstract.test
new file mode 100644
index 000000000..e207baf90
--- /dev/null
+++ b/tests/semantic/method-extern-abstract.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+abstract class Foo {
+ public extern abstract void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-extern-body.test b/tests/semantic/method-extern-body.test
new file mode 100644
index 000000000..0ca2dc8d1
--- /dev/null
+++ b/tests/semantic/method-extern-body.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+extern void foo () {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-extern-virtual.test b/tests/semantic/method-extern-virtual.test
new file mode 100644
index 000000000..0cac0b57b
--- /dev/null
+++ b/tests/semantic/method-extern-virtual.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+class Foo {
+ public extern virtual void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-main-async.test b/tests/semantic/method-main-async.test
new file mode 100644
index 000000000..df468fa9f
--- /dev/null
+++ b/tests/semantic/method-main-async.test
@@ -0,0 +1,5 @@
+Packages: gio-2.0
+Invalid Code
+
+async void main () {
+}
diff --git a/tests/semantic/method-main-inline.test b/tests/semantic/method-main-inline.test
new file mode 100644
index 000000000..c2afe6447
--- /dev/null
+++ b/tests/semantic/method-main-inline.test
@@ -0,0 +1,4 @@
+Invalid Code
+
+inline void main () {
+}
diff --git a/tests/semantic/method-main-throws.test b/tests/semantic/method-main-throws.test
new file mode 100644
index 000000000..56f0ba144
--- /dev/null
+++ b/tests/semantic/method-main-throws.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+errordomain FooError {
+ BAR
+}
+
+void main () throws FooError {
+}
diff --git a/tests/semantic/method-override.test b/tests/semantic/method-override.test
new file mode 100644
index 000000000..a7cf1b4f7
--- /dev/null
+++ b/tests/semantic/method-override.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+override void foo () {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-postcondition.test b/tests/semantic/method-postcondition.test
new file mode 100644
index 000000000..672c1471f
--- /dev/null
+++ b/tests/semantic/method-postcondition.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+void foo (int i) ensures (i) {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-precondition.test b/tests/semantic/method-precondition.test
new file mode 100644
index 000000000..019740ddf
--- /dev/null
+++ b/tests/semantic/method-precondition.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+void foo (int i) requires (i) {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-private-abstract.test b/tests/semantic/method-private-abstract.test
new file mode 100644
index 000000000..27ae82c3b
--- /dev/null
+++ b/tests/semantic/method-private-abstract.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+abstract class Foo {
+ abstract void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-private-override.test b/tests/semantic/method-private-override.test
new file mode 100644
index 000000000..def7d8632
--- /dev/null
+++ b/tests/semantic/method-private-override.test
@@ -0,0 +1,14 @@
+Invalid Code
+
+class Foo {
+ public virtual void foo () {
+ }
+}
+
+class Bar : Foo {
+ override void foo () {
+ }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-private-virtual.test b/tests/semantic/method-private-virtual.test
new file mode 100644
index 000000000..956ca34d0
--- /dev/null
+++ b/tests/semantic/method-private-virtual.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+class Foo {
+ virtual void foo () {
+ }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-protected.test b/tests/semantic/method-protected.test
new file mode 100644
index 000000000..c1740d496
--- /dev/null
+++ b/tests/semantic/method-protected.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+protected void foo () {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-return-accessibility.test b/tests/semantic/method-return-accessibility.test
new file mode 100644
index 000000000..91c3c9675
--- /dev/null
+++ b/tests/semantic/method-return-accessibility.test
@@ -0,0 +1,10 @@
+Invalid Code
+
+class Foo {
+}
+
+public Foo foo () {
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-virtual-body.test b/tests/semantic/method-virtual-body.test
new file mode 100644
index 000000000..82fd2d7f4
--- /dev/null
+++ b/tests/semantic/method-virtual-body.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+public void foo ();
+
+void main () {
+}
diff --git a/tests/semantic/method-virtual.test b/tests/semantic/method-virtual.test
new file mode 100644
index 000000000..553cd5605
--- /dev/null
+++ b/tests/semantic/method-virtual.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+virtual void foo () {
+}
+
+void main () {
+}