]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add some invalid "signal" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 22 Sep 2018 16:30:17 +0000 (18:30 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 23 Sep 2018 07:41:05 +0000 (09:41 +0200)
tests/Makefile.am
tests/semantic/signal-clash-inherited.test [new file with mode: 0644]
tests/semantic/signal-compact-class.test [new file with mode: 0644]
tests/semantic/signal-detail-invalid.test [new file with mode: 0644]
tests/semantic/signal-detail-non-string.test [new file with mode: 0644]

index da1b3316946578e9aa14dafe7ae30b0050925daf..268d2b8d474abbd8e57e55606a24cafa7b33b376 100644 (file)
@@ -599,6 +599,10 @@ TESTS = \
        semantic/property-struct-protected.test \
        semantic/property-struct-virtual.test \
        semantic/property-void.test \
+       semantic/signal-clash-inherited.test \
+       semantic/signal-compact-class.test \
+       semantic/signal-detail-invalid.test \
+       semantic/signal-detail-non-string.test \
        semantic/struct-derived.test \
        semantic/struct-field-initializer.test \
        semantic/struct-invalid-base.test \
diff --git a/tests/semantic/signal-clash-inherited.test b/tests/semantic/signal-clash-inherited.test
new file mode 100644 (file)
index 0000000..6cceb9a
--- /dev/null
@@ -0,0 +1,12 @@
+Invalid Code
+
+class Foo {
+       public signal void foo ();
+}
+
+class Bar : Foo {
+       public new signal void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/signal-compact-class.test b/tests/semantic/signal-compact-class.test
new file mode 100644 (file)
index 0000000..da608e1
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+[Compact]
+class Foo {
+       public signal void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/signal-detail-invalid.test b/tests/semantic/signal-detail-invalid.test
new file mode 100644 (file)
index 0000000..c5a2ad4
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo {
+       [Signal (detailed = true)]
+       public signal void foo ();
+}
+
+void main () {
+       var foo = new Foo ();
+       foo.foo["detail", "fail"].connect (() => {});
+}
diff --git a/tests/semantic/signal-detail-non-string.test b/tests/semantic/signal-detail-non-string.test
new file mode 100644 (file)
index 0000000..ca6fe60
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo {
+       [Signal (detailed = true)]
+       public signal void foo ();
+}
+
+void main () {
+       var foo = new Foo ();
+       foo.foo[42].connect (() => {});
+}