]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "struct" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 13:15:25 +0000 (14:15 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 13:15:25 +0000 (14:15 +0100)
tests/Makefile.am
tests/semantic/struct-derived.test [new file with mode: 0644]
tests/semantic/struct-field-initializer.test [new file with mode: 0644]
tests/semantic/struct-invalid-base.test [new file with mode: 0644]
tests/semantic/struct-recursive.test [new file with mode: 0644]

index 8a1e859c79cd648542b16ee228c01df8f4cd83e2..a496d85d45e8fab3f31cc897e2956efccf1b27e9 100644 (file)
@@ -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 (file)
index 0000000..f33f411
--- /dev/null
@@ -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 (file)
index 0000000..ced66c4
--- /dev/null
@@ -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 (file)
index 0000000..b21047c
--- /dev/null
@@ -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 (file)
index 0000000..6b55255
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+struct Foo {
+       public Foo foo;
+}
+
+void main () {
+}