[vala/wip/tests] tests: Add invalid "method" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/tests] tests: Add invalid "method" tests to increase coverage
- Date: Mon, 5 Feb 2018 15:20:47 +0000 (UTC)
commit b03d7515ac261c85f5f6126cd6500087be0ee5ea
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Feb 5 16:19:56 2018 +0100
tests: Add invalid "method" tests to increase coverage
tests/Makefile.am | 23 +++++++++++++++++++++++
tests/semantic/method-abstract-body.test | 9 +++++++++
tests/semantic/method-abstract.test | 8 ++++++++
tests/semantic/method-async-ref-parameter.test | 8 ++++++++
tests/semantic/method-body.test | 6 ++++++
tests/semantic/method-class-abstract.test | 8 ++++++++
tests/semantic/method-derived-compact.test | 13 +++++++++++++
tests/semantic/method-error-accessibility.test | 11 +++++++++++
tests/semantic/method-extern-abstract.test | 8 ++++++++
tests/semantic/method-extern-body.test | 7 +++++++
tests/semantic/method-extern-virtual.test | 8 ++++++++
tests/semantic/method-main-async.test | 5 +++++
tests/semantic/method-main-inline.test | 4 ++++
tests/semantic/method-main-throws.test | 8 ++++++++
tests/semantic/method-override.test | 7 +++++++
tests/semantic/method-postcondition.test | 7 +++++++
tests/semantic/method-precondition.test | 7 +++++++
tests/semantic/method-private-abstract.test | 8 ++++++++
tests/semantic/method-private-override.test | 14 ++++++++++++++
tests/semantic/method-private-virtual.test | 9 +++++++++
tests/semantic/method-protected.test | 7 +++++++
tests/semantic/method-return-accessibility.test | 10 ++++++++++
tests/semantic/method-virtual-body.test | 6 ++++++
tests/semantic/method-virtual.test | 7 +++++++
24 files changed, 208 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a496d85..936d141 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 0000000..bfbf097
--- /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 0000000..fe8f7ae
--- /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 0000000..47a8a93
--- /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 0000000..47a3763
--- /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 0000000..08df0e7
--- /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 0000000..ac257a9
--- /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 0000000..f150aa8
--- /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 0000000..e207baf
--- /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 0000000..0ca2dc8
--- /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 0000000..0cac0b5
--- /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 0000000..df468fa
--- /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 0000000..c2afe64
--- /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 0000000..56f0ba1
--- /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 0000000..a7cf1b4
--- /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 0000000..672c147
--- /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 0000000..019740d
--- /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 0000000..27ae82c
--- /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 0000000..def7d86
--- /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 0000000..956ca34
--- /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 0000000..c1740d4
--- /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 0000000..91c3c96
--- /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 0000000..82fd2d7
--- /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 0000000..553cd56
--- /dev/null
+++ b/tests/semantic/method-virtual.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+virtual void foo () {
+}
+
+void main () {
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]