From: Rico Tzschichholz Date: Mon, 5 Feb 2018 13:15:25 +0000 (+0100) Subject: tests: Add invalid "struct" tests to increase coverage X-Git-Tag: 0.39.91~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e2c44d0d6a20d3cd4f1ae8833f933e9a8a4a2b;p=thirdparty%2Fvala.git tests: Add invalid "struct" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 8a1e859c7..a496d85d4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -450,6 +450,10 @@ TESTS = \ semantic/property-struct-protected.test \ semantic/property-struct-virtual.test \ semantic/property-void.test \ + semantic/struct-derived.test \ + semantic/struct-field-initializer.test \ + semantic/struct-invalid-base.test \ + semantic/struct-recursive.test \ $(NULL) NON_NULL_TESTS = \ diff --git a/tests/semantic/struct-derived.test b/tests/semantic/struct-derived.test new file mode 100644 index 000000000..f33f41155 --- /dev/null +++ b/tests/semantic/struct-derived.test @@ -0,0 +1,12 @@ +Invalid Code + +struct Foo { + public int i; +} + +struct Bar : Foo { + public int j; +} + +void main () { +} diff --git a/tests/semantic/struct-field-initializer.test b/tests/semantic/struct-field-initializer.test new file mode 100644 index 000000000..ced66c4d8 --- /dev/null +++ b/tests/semantic/struct-field-initializer.test @@ -0,0 +1,8 @@ +Invalid Code + +struct Foo { + public int i = 42; +} + +void main () { +} diff --git a/tests/semantic/struct-invalid-base.test b/tests/semantic/struct-invalid-base.test new file mode 100644 index 000000000..b21047c66 --- /dev/null +++ b/tests/semantic/struct-invalid-base.test @@ -0,0 +1,11 @@ +Invalid Code + +class Foo { +} + +struct Bar : Foo { +} + +void main () { +} + diff --git a/tests/semantic/struct-recursive.test b/tests/semantic/struct-recursive.test new file mode 100644 index 000000000..6b552551c --- /dev/null +++ b/tests/semantic/struct-recursive.test @@ -0,0 +1,8 @@ +Invalid Code + +struct Foo { + public Foo foo; +} + +void main () { +}