[vala/0.40] tests: Add invalid "object creation" tests to increase coverage



commit 96fe666f4235763f30c73ef7a0cf08f7a5e9d42c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 22 10:42:55 2018 +0200

    tests: Add invalid "object creation" tests to increase coverage

 tests/Makefile.am                                         |  4 ++++
 tests/semantic/objectcreation-abstract-class.test         |  8 ++++++++
 tests/semantic/objectcreation-no-creation-method.test     |  8 ++++++++
 tests/semantic/objectcreation-non-public-constructor.test | 10 ++++++++++
 tests/semantic/objectcreation-unsupported-type.test       |  9 +++++++++
 5 files changed, 39 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4372f1ad6..74542bd2e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -559,6 +559,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
index 000000000..37234b5e5
--- /dev/null
+++ b/tests/semantic/objectcreation-abstract-class.test
@@ -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
index 000000000..17195fa31
--- /dev/null
+++ b/tests/semantic/objectcreation-no-creation-method.test
@@ -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
index 000000000..aa5ce3a57
--- /dev/null
+++ b/tests/semantic/objectcreation-non-public-constructor.test
@@ -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
index 000000000..163f71c51
--- /dev/null
+++ b/tests/semantic/objectcreation-unsupported-type.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+enum Bar {
+       NONE
+}
+
+void main () {
+       var foo = new Bar ();
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]