]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "async signal handler" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 5 Jan 2022 07:25:19 +0000 (08:25 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 8 Jan 2022 11:20:48 +0000 (12:20 +0100)
tests/Makefile.am
tests/asynchronous/bug602594.vala [new file with mode: 0644]

index 432ecfeb9761b0c5c57099c04268cddaa8e2e2a5..484e0d5be37301014ba24e89d1178112c3901dc7 100644 (file)
@@ -671,6 +671,7 @@ TESTS = \
        asynchronous/bug599568.vala \
        asynchronous/bug600827.vala \
        asynchronous/bug601558.vala \
+       asynchronous/bug602594.vala \
        asynchronous/bug612641.vala \
        asynchronous/bug613484.vala \
        asynchronous/bug614294.vala \
diff --git a/tests/asynchronous/bug602594.vala b/tests/asynchronous/bug602594.vala
new file mode 100644 (file)
index 0000000..5c81293
--- /dev/null
@@ -0,0 +1,18 @@
+class Foo {
+       public signal void bar (string s, bool b);
+}
+
+async void callback (string s, bool b) {
+       assert (s == "foo");
+       assert (b);
+       success = true;
+}
+
+bool success = false;
+
+void main() {
+       var foo = new Foo ();
+       foo.bar.connect (callback);
+       foo.bar ("foo", true);
+       assert (success);
+}