]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "object creation" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 22 Sep 2018 08:42:55 +0000 (10:42 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 22 Sep 2018 08:44:33 +0000 (10:44 +0200)
tests/Makefile.am
tests/semantic/objectcreation-abstract-class.test [new file with mode: 0644]
tests/semantic/objectcreation-no-creation-method.test [new file with mode: 0644]
tests/semantic/objectcreation-non-public-constructor.test [new file with mode: 0644]
tests/semantic/objectcreation-unsupported-type.test [new file with mode: 0644]

index acbb59986543e9522e25ea4181ef9e376565decd..4cd23bb4b0eb75cffcaaeb2cf62665eff65de5a3 100644 (file)
@@ -575,6 +575,10 @@ TESTS = \
        semantic/method-too-many-type-arguments.test \
        semantic/method-virtual.test \
        semantic/method-virtual-body.test \
+       semantic/objectcreation-abstract-class.test \
+       semantic/objectcreation-no-creation-method.test \
+       semantic/objectcreation-non-public-constructor.test \
+       semantic/objectcreation-unsupported-type.test \
        semantic/parameter-accessibility.test \
        semantic/parameter-default-type.test \
        semantic/parameter-out-default.test \
diff --git a/tests/semantic/objectcreation-abstract-class.test b/tests/semantic/objectcreation-abstract-class.test
new file mode 100644 (file)
index 0000000..37234b5
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+abstract class Foo {
+}
+
+void main () {
+       var foo = new Foo ();
+}
diff --git a/tests/semantic/objectcreation-no-creation-method.test b/tests/semantic/objectcreation-no-creation-method.test
new file mode 100644 (file)
index 0000000..17195fa
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+void bar () {
+}
+
+void main () {
+       var foo = new Foo.bar ();
+}
diff --git a/tests/semantic/objectcreation-non-public-constructor.test b/tests/semantic/objectcreation-non-public-constructor.test
new file mode 100644 (file)
index 0000000..aa5ce3a
--- /dev/null
@@ -0,0 +1,10 @@
+Invalid Code
+
+class Foo {
+       Foo () {
+       }
+}
+
+void main () {
+       var foo = new Foo ();
+}
diff --git a/tests/semantic/objectcreation-unsupported-type.test b/tests/semantic/objectcreation-unsupported-type.test
new file mode 100644 (file)
index 0000000..163f71c
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+enum Bar {
+       NONE
+}
+
+void main () {
+       var foo = new Bar ();
+}