[vala/wip/tests] tests: Add invalid "struct" tests to increase coverage



commit 05e2c44d0d6a20d3cd4f1ae8833f933e9a8a4a2b
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Feb 5 14:15:25 2018 +0100

    tests: Add invalid "struct" tests to increase coverage

 tests/Makefile.am                            |    4 ++++
 tests/semantic/struct-derived.test           |   12 ++++++++++++
 tests/semantic/struct-field-initializer.test |    8 ++++++++
 tests/semantic/struct-invalid-base.test      |   11 +++++++++++
 tests/semantic/struct-recursive.test         |    8 ++++++++
 5 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8a1e859..a496d85 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 0000000..f33f411
--- /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 0000000..ced66c4
--- /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 0000000..b21047c
--- /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 0000000..6b55255
--- /dev/null
+++ b/tests/semantic/struct-recursive.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+struct Foo {
+       public Foo foo;
+}
+
+void main () {
+}


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