summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-02-05 14:15:25 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-02-05 14:15:25 +0100
commit05e2c44d0d6a20d3cd4f1ae8833f933e9a8a4a2b (patch)
treeae8849909d9bf0152ef4192ad18328a5ff537365
parent117040095ee28b1374e54f0212a2886ef38aa104 (diff)
downloadvala-05e2c44d0d6a20d3cd4f1ae8833f933e9a8a4a2b.tar.gz
tests: Add invalid "struct" tests to increase coverage
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/semantic/struct-derived.test12
-rw-r--r--tests/semantic/struct-field-initializer.test8
-rw-r--r--tests/semantic/struct-invalid-base.test11
-rw-r--r--tests/semantic/struct-recursive.test8
5 files changed, 43 insertions, 0 deletions
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 () {
+}