]> 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>
Tue, 24 Sep 2019 11:42:47 +0000 (13:42 +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 4eb13b1209bf8036e2db3f5a234bedb7b4f35e4d..bb374221a1d69b6bb4f3310025909c57b02d9af2 100644 (file)
@@ -725,6 +725,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 \
@@ -739,6 +741,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 \
@@ -752,7 +756,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;
+}