[vala/0.42] tests: Add invalid "object creation" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.42] tests: Add invalid "object creation" tests to increase coverage
- Date: Sun, 23 Sep 2018 09:07:05 +0000 (UTC)
commit 615ca184408b334937c9ee4a7d169ad659f2510a
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 acbb59986..4cd23bb4b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
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]