]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "method" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 15:19:56 +0000 (16:19 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 15:19:56 +0000 (16:19 +0100)
24 files changed:
tests/Makefile.am
tests/semantic/method-abstract-body.test [new file with mode: 0644]
tests/semantic/method-abstract.test [new file with mode: 0644]
tests/semantic/method-async-ref-parameter.test [new file with mode: 0644]
tests/semantic/method-body.test [new file with mode: 0644]
tests/semantic/method-class-abstract.test [new file with mode: 0644]
tests/semantic/method-derived-compact.test [new file with mode: 0644]
tests/semantic/method-error-accessibility.test [new file with mode: 0644]
tests/semantic/method-extern-abstract.test [new file with mode: 0644]
tests/semantic/method-extern-body.test [new file with mode: 0644]
tests/semantic/method-extern-virtual.test [new file with mode: 0644]
tests/semantic/method-main-async.test [new file with mode: 0644]
tests/semantic/method-main-inline.test [new file with mode: 0644]
tests/semantic/method-main-throws.test [new file with mode: 0644]
tests/semantic/method-override.test [new file with mode: 0644]
tests/semantic/method-postcondition.test [new file with mode: 0644]
tests/semantic/method-precondition.test [new file with mode: 0644]
tests/semantic/method-private-abstract.test [new file with mode: 0644]
tests/semantic/method-private-override.test [new file with mode: 0644]
tests/semantic/method-private-virtual.test [new file with mode: 0644]
tests/semantic/method-protected.test [new file with mode: 0644]
tests/semantic/method-return-accessibility.test [new file with mode: 0644]
tests/semantic/method-virtual-body.test [new file with mode: 0644]
tests/semantic/method-virtual.test [new file with mode: 0644]

index a496d85d45e8fab3f31cc897e2956efccf1b27e9..936d141f3fa99f3a211ebb752e783abcf5feda4e 100644 (file)
@@ -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 (file)
index 0000000..bfbf097
--- /dev/null
@@ -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 (file)
index 0000000..fe8f7ae
--- /dev/null
@@ -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 (file)
index 0000000..47a8a93
--- /dev/null
@@ -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 (file)
index 0000000..47a3763
--- /dev/null
@@ -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 (file)
index 0000000..08df0e7
--- /dev/null
@@ -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 (file)
index 0000000..ac257a9
--- /dev/null
@@ -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 (file)
index 0000000..f150aa8
--- /dev/null
@@ -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 (file)
index 0000000..e207baf
--- /dev/null
@@ -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 (file)
index 0000000..0ca2dc8
--- /dev/null
@@ -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 (file)
index 0000000..0cac0b5
--- /dev/null
@@ -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 (file)
index 0000000..df468fa
--- /dev/null
@@ -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 (file)
index 0000000..c2afe64
--- /dev/null
@@ -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 (file)
index 0000000..56f0ba1
--- /dev/null
@@ -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 (file)
index 0000000..a7cf1b4
--- /dev/null
@@ -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 (file)
index 0000000..672c147
--- /dev/null
@@ -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 (file)
index 0000000..019740d
--- /dev/null
@@ -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 (file)
index 0000000..27ae82c
--- /dev/null
@@ -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 (file)
index 0000000..def7d86
--- /dev/null
@@ -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 (file)
index 0000000..956ca34
--- /dev/null
@@ -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 (file)
index 0000000..c1740d4
--- /dev/null
@@ -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 (file)
index 0000000..91c3c96
--- /dev/null
@@ -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 (file)
index 0000000..82fd2d7
--- /dev/null
@@ -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 (file)
index 0000000..553cd56
--- /dev/null
@@ -0,0 +1,7 @@
+Invalid Code
+
+virtual void foo () {
+}
+
+void main () {
+}