[vala/0.42] tests: Add invalid "property for Object() chainup" tests to increase coverage



commit d40702d4d5cbba10ac339b5a28231f529e87ed22
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Sep 21 18:12:49 2018 +0200

    tests: Add invalid "property for Object() chainup" tests to increase coverage

 tests/Makefile.am                                     |  3 +++
 .../chainup-gobject-incompatible-type-property.test   | 14 ++++++++++++++
 tests/semantic/chainup-gobject-unknown-property.test  | 13 +++++++++++++
 .../chainup-gobject-unsupported-type-property.test    | 19 +++++++++++++++++++
 4 files changed, 49 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d41f7ccb4..1057f72a3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -492,6 +492,9 @@ TESTS = \
        semantic/assignment-same-variable.vala \
        semantic/assignment-signal-incompatible-method.test \
        semantic/assignment-signal-incompatible-type.test \
+       semantic/chainup-gobject-incompatible-type-property.test \
+       semantic/chainup-gobject-unknown-property.test \
+       semantic/chainup-gobject-unsupported-type-property.test \
        semantic/class-base-type-invalid.test \
        semantic/class-base-type-less-accessible.test \
        semantic/class-compact-derived-instance-field.test \
diff --git a/tests/semantic/chainup-gobject-incompatible-type-property.test 
b/tests/semantic/chainup-gobject-incompatible-type-property.test
new file mode 100644
index 000000000..bd0dfc652
--- /dev/null
+++ b/tests/semantic/chainup-gobject-incompatible-type-property.test
@@ -0,0 +1,14 @@
+Invalid Code
+
+class Foo : Object {
+       public string s { get; construct; }
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (s: 42);
+       }
+}
+
+void main () {
+}
diff --git a/tests/semantic/chainup-gobject-unknown-property.test 
b/tests/semantic/chainup-gobject-unknown-property.test
new file mode 100644
index 000000000..b7648b52a
--- /dev/null
+++ b/tests/semantic/chainup-gobject-unknown-property.test
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Foo : Object {
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (unknown: "foo");
+       }
+}
+
+void main () {
+}
diff --git a/tests/semantic/chainup-gobject-unsupported-type-property.test 
b/tests/semantic/chainup-gobject-unsupported-type-property.test
new file mode 100644
index 000000000..49ee6f7dd
--- /dev/null
+++ b/tests/semantic/chainup-gobject-unsupported-type-property.test
@@ -0,0 +1,19 @@
+Invalid Code
+
+delegate void Func ();
+
+class Foo : Object {
+       public Func f { get; construct; }
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (f: func);
+       }
+
+       void func () {
+       }
+}
+
+void main () {
+}


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