]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add more "invalid expression" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 24 Sep 2019 11:21:44 +0000 (13:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:45:55 +0000 (13:45 +0200)
tests/Makefile.am
tests/semantic/pointer-indirection-type-not-supported.test [new file with mode: 0644]
tests/semantic/pointer-indirection-void-not-supported.test [new file with mode: 0644]
tests/semantic/reference-transfer-not-supported.test [new file with mode: 0644]
tests/semantic/reference-transfer-unavailable.test [new file with mode: 0644]
tests/semantic/throw-no-error-type.test [new file with mode: 0644]
tests/semantic/unary-unsupported-complement.test [new file with mode: 0644]
tests/semantic/unary-unsupported-increment.test [new file with mode: 0644]
tests/semantic/unary-unsupported-minus.test [new file with mode: 0644]
tests/semantic/unary-unsupported-negation.test [new file with mode: 0644]

index bbe340fb72b9a62435531f31b4c25d424385d425..4f88ae151d03e8597b623c2cf4c33e6817c98d64 100644 (file)
@@ -720,6 +720,8 @@ TESTS = \
        semantic/parameter-params.test \
        semantic/parameter-ref-default.test \
        semantic/parameter-void.test \
+       semantic/pointer-indirection-type-not-supported.test \
+       semantic/pointer-indirection-void-not-supported.test \
        semantic/property-abstract.test \
        semantic/property-abstract-derived-compact.test \
        semantic/property-accessibility.test \
@@ -734,6 +736,8 @@ TESTS = \
        semantic/property-struct-protected.test \
        semantic/property-struct-virtual.test \
        semantic/property-void.test \
+       semantic/reference-transfer-not-supported.test \
+       semantic/reference-transfer-unavailable.test \
        semantic/signal-clash-inherited.test \
        semantic/signal-compact-class.test \
        semantic/signal-detail-invalid.test \
@@ -747,7 +751,12 @@ TESTS = \
        semantic/switch-label-not-compatible.test \
        semantic/switch-label-not-constant.test \
        semantic/switch-type-unsupported.test \
+       semantic/throw-no-error-type.test \
        semantic/type-argument-ownership-mismatch.test \
+       semantic/unary-unsupported-complement.test \
+       semantic/unary-unsupported-increment.test \
+       semantic/unary-unsupported-minus.test \
+       semantic/unary-unsupported-negation.test \
        semantic/yield-call-requires-async-context.test \
        semantic/yield-call-requires-async-method.test \
        semantic/yield-creation-requires-async-context.test \
diff --git a/tests/semantic/pointer-indirection-type-not-supported.test b/tests/semantic/pointer-indirection-type-not-supported.test
new file mode 100644 (file)
index 0000000..64f7c6c
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       string foo = "foo";
+       *foo = null;
+}
diff --git a/tests/semantic/pointer-indirection-void-not-supported.test b/tests/semantic/pointer-indirection-void-not-supported.test
new file mode 100644 (file)
index 0000000..d10f65f
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       void* foo = null;
+       *foo = null;
+}
diff --git a/tests/semantic/reference-transfer-not-supported.test b/tests/semantic/reference-transfer-not-supported.test
new file mode 100644 (file)
index 0000000..4f24445
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+string foo () {
+       return "foo";
+}
+
+void main () {
+       string s = (owned) foo ();
+}
diff --git a/tests/semantic/reference-transfer-unavailable.test b/tests/semantic/reference-transfer-unavailable.test
new file mode 100644 (file)
index 0000000..5a343b8
--- /dev/null
@@ -0,0 +1,7 @@
+Invalid Code
+
+unowned string foo = "foo";
+
+void main () {
+       string s = (owned) foo;
+}
diff --git a/tests/semantic/throw-no-error-type.test b/tests/semantic/throw-no-error-type.test
new file mode 100644 (file)
index 0000000..6b55255
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+struct Foo {
+       public Foo foo;
+}
+
+void main () {
+}
diff --git a/tests/semantic/unary-unsupported-complement.test b/tests/semantic/unary-unsupported-complement.test
new file mode 100644 (file)
index 0000000..4b02110
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       string foo = "foo";
+       var s = ~foo;
+}
diff --git a/tests/semantic/unary-unsupported-increment.test b/tests/semantic/unary-unsupported-increment.test
new file mode 100644 (file)
index 0000000..880e324
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       string foo = "foo";
+       var s = ++foo;
+}
diff --git a/tests/semantic/unary-unsupported-minus.test b/tests/semantic/unary-unsupported-minus.test
new file mode 100644 (file)
index 0000000..484d41b
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       string foo = "foo";
+       var s = -foo;
+}
diff --git a/tests/semantic/unary-unsupported-negation.test b/tests/semantic/unary-unsupported-negation.test
new file mode 100644 (file)
index 0000000..e002765
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       string foo = "foo";
+       var s = !foo;
+}