]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add more method tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 17 May 2023 20:40:53 +0000 (22:40 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 17 May 2023 20:40:53 +0000 (22:40 +0200)
tests/Makefile.am
tests/semantic/method-override-no-class.test [new file with mode: 0644]
tests/semantic/method-virtual-no-class-or-interface.test [new file with mode: 0644]

index daf2a8cf91ca0478f148f480f7c76e7917f058aa..4596d53106d6374e40a3492ad54a776af4b3d84b 100644 (file)
@@ -1234,6 +1234,7 @@ TESTS = \
        semantic/method-main-inline.test \
        semantic/method-main-throws.test \
        semantic/method-override.test \
+       semantic/method-override-no-class.test \
        semantic/method-postcondition.test \
        semantic/method-precondition.test \
        semantic/method-private-abstract.test \
@@ -1249,6 +1250,7 @@ TESTS = \
        semantic/method-too-many-type-arguments.test \
        semantic/method-virtual.test \
        semantic/method-virtual-body.test \
+       semantic/method-virtual-no-class-or-interface.test \
        semantic/methodcall-field-initializer-throws.test \
        semantic/methodcall-invalid-argument-lambda.test \
        semantic/methodcall-invocation-invalid.test \
diff --git a/tests/semantic/method-override-no-class.test b/tests/semantic/method-override-no-class.test
new file mode 100644 (file)
index 0000000..f881aa4
--- /dev/null
@@ -0,0 +1,14 @@
+Invalid Code
+
+class Foo {
+       public virtual void foo () {
+       }
+}
+
+interface Bar : Foo {
+       public override void foo () {
+       }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-virtual-no-class-or-interface.test b/tests/semantic/method-virtual-no-class-or-interface.test
new file mode 100644 (file)
index 0000000..6b1161f
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+struct Foo {
+       public int i;
+
+       public virtual void foo () {
+       }
+}
+
+void main () {
+}