From d40702d4d5cbba10ac339b5a28231f529e87ed22 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 21 Sep 2018 18:12:49 +0200 Subject: [PATCH] tests: Add invalid "property for Object() chainup" tests to increase coverage --- tests/Makefile.am | 3 +++ ...up-gobject-incompatible-type-property.test | 14 ++++++++++++++ .../chainup-gobject-unknown-property.test | 13 +++++++++++++ ...nup-gobject-unsupported-type-property.test | 19 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 tests/semantic/chainup-gobject-incompatible-type-property.test create mode 100644 tests/semantic/chainup-gobject-unknown-property.test create mode 100644 tests/semantic/chainup-gobject-unsupported-type-property.test 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 () { +} -- 2.47.2