From: Rico Tzschichholz Date: Mon, 5 Feb 2018 08:39:30 +0000 (+0100) Subject: tests: Add invalid "property" tests to increase coverage X-Git-Tag: 0.39.91~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ba8c10814373f19d1bd4d8e1c45715500aa8925;p=thirdparty%2Fvala.git tests: Add invalid "property" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 0a8139bc8..6eb70cea0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -405,6 +405,19 @@ TESTS = \ semantic/parameter-params.test \ semantic/parameter-ref-default.test \ semantic/parameter-void.test \ + semantic/property-abstract.test \ + semantic/property-abstract-derived-compact.test \ + semantic/property-accessibility.test \ + semantic/property-construct.test \ + semantic/property-initializer-type.test \ + semantic/property-override.test \ + semantic/property-override-class.test \ + semantic/property-override-interface.test \ + semantic/property-struct-abstract.test \ + semantic/property-struct-override.test \ + semantic/property-struct-protected.test \ + semantic/property-struct-virtual.test \ + semantic/property-void.test \ $(NULL) NON_NULL_TESTS = \ diff --git a/tests/semantic/property-abstract-derived-compact.test b/tests/semantic/property-abstract-derived-compact.test new file mode 100644 index 000000000..02d38d394 --- /dev/null +++ b/tests/semantic/property-abstract-derived-compact.test @@ -0,0 +1,12 @@ +Invalid Code + +[Compact] +class Foo { +} + +class Bar : Foo { + public abstract string foo { get; } +} + +void main () { +} diff --git a/tests/semantic/property-abstract.test b/tests/semantic/property-abstract.test new file mode 100644 index 000000000..41fc955c0 --- /dev/null +++ b/tests/semantic/property-abstract.test @@ -0,0 +1,8 @@ +Invalid Code + +class Bar { + public abstract string foo { get; } +} + +void main () { +} diff --git a/tests/semantic/property-accessibility.test b/tests/semantic/property-accessibility.test new file mode 100644 index 000000000..d5327238e --- /dev/null +++ b/tests/semantic/property-accessibility.test @@ -0,0 +1,11 @@ +Invalid Code + +class Bar { +} + +public class Foo { + public Bar foo { get; set; } +} + +void main () { +} diff --git a/tests/semantic/property-construct.test b/tests/semantic/property-construct.test new file mode 100644 index 000000000..25f73cd2f --- /dev/null +++ b/tests/semantic/property-construct.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { + string foo { get; construct set; } +} + +void main () { +} diff --git a/tests/semantic/property-initializer-type.test b/tests/semantic/property-initializer-type.test new file mode 100644 index 000000000..201fc58e6 --- /dev/null +++ b/tests/semantic/property-initializer-type.test @@ -0,0 +1,8 @@ +Invalid Code + +public class Foo { + public string foo { get; set; default = 23; } +} + +void main () { +} diff --git a/tests/semantic/property-override-class.test b/tests/semantic/property-override-class.test new file mode 100644 index 000000000..1bf51c6eb --- /dev/null +++ b/tests/semantic/property-override-class.test @@ -0,0 +1,13 @@ +Invalid Code + +class Bar { + public virtual int foo { get; set; } +} + +class Foo : Bar { + public override string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-override-interface.test b/tests/semantic/property-override-interface.test new file mode 100644 index 000000000..317ba7727 --- /dev/null +++ b/tests/semantic/property-override-interface.test @@ -0,0 +1,13 @@ +Invalid Code + +interface Bar { + public abstract int foo { get; set; } +} + +class Foo : Bar { + public override string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-override.test b/tests/semantic/property-override.test new file mode 100644 index 000000000..c7146966c --- /dev/null +++ b/tests/semantic/property-override.test @@ -0,0 +1,12 @@ +Invalid Code + +class Bar { +} + +class Foo : Bar { + public override string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-struct-abstract.test b/tests/semantic/property-struct-abstract.test new file mode 100644 index 000000000..4f4437aa2 --- /dev/null +++ b/tests/semantic/property-struct-abstract.test @@ -0,0 +1,9 @@ +Invalid Code + +struct Foo { + public abstract string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-struct-override.test b/tests/semantic/property-struct-override.test new file mode 100644 index 000000000..5a599dcef --- /dev/null +++ b/tests/semantic/property-struct-override.test @@ -0,0 +1,9 @@ +Invalid Code + +struct Foo { + public override string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-struct-protected.test b/tests/semantic/property-struct-protected.test new file mode 100644 index 000000000..00622911b --- /dev/null +++ b/tests/semantic/property-struct-protected.test @@ -0,0 +1,9 @@ +Invalid Code + +struct Foo { + protected string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-struct-virtual.test b/tests/semantic/property-struct-virtual.test new file mode 100644 index 000000000..a6c593f70 --- /dev/null +++ b/tests/semantic/property-struct-virtual.test @@ -0,0 +1,9 @@ +Invalid Code + +struct Foo { + public virtual string foo { get; set; } +} + +void main () { +} + diff --git a/tests/semantic/property-void.test b/tests/semantic/property-void.test new file mode 100644 index 000000000..abfb42830 --- /dev/null +++ b/tests/semantic/property-void.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { + public void foo { get; set; } +} + +void main () { +}