[vala/0.52] tests: Add "async signal handler" test to increase coverage



commit d7ae5f546bd23ca7bc717690ddcf9d365a747e4c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jan 5 08:25:19 2022 +0100

    tests: Add "async signal handler" test to increase coverage

 tests/Makefile.am                 |  1 +
 tests/asynchronous/bug602594.vala | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 432ecfeb9..484e0d5be 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 000000000..5c8129312
--- /dev/null
+++ b/tests/asynchronous/bug602594.vala
@@ -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);
+}


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