[vala/0.48] tests: Add "signal error marshalling" test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] tests: Add "signal error marshalling" test to increase coverage
- Date: Mon, 10 Aug 2020 07:18:18 +0000 (UTC)
commit b088dbedc8624bbbf20e6e52ee3b06cdb6a3bb21
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Jul 20 10:37:53 2020 +0200
tests: Add "signal error marshalling" test to increase coverage
tests/Makefile.am | 1 +
tests/objects/signals-error-marshal.vala | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9f91e6478..bbabf89ff 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -439,6 +439,7 @@ TESTS = \
objects/signals-delegate.vala \
objects/signals-delegate-parameter.vala \
objects/signals-dymanic-invalid-handler.test \
+ objects/signals-error-marshal.vala \
objects/signals-fundamental-return.vala \
objects/signals-gobject-return.vala \
objects/signals-lambda-delegate.vala \
diff --git a/tests/objects/signals-error-marshal.vala b/tests/objects/signals-error-marshal.vala
new file mode 100644
index 000000000..b727777e2
--- /dev/null
+++ b/tests/objects/signals-error-marshal.vala
@@ -0,0 +1,26 @@
+errordomain FooError {
+ BAD;
+}
+
+struct Bar {
+ public int i;
+}
+
+class Foo : GLib.Object {
+ signal void foo (void* p, Bar bar);
+ signal void bar (void* p, Error e);
+
+ public Foo () {
+ bar.connect (callback);
+ bar (null, new FooError.BAD ("bad"));
+ }
+
+ void callback (void* p, Error e) {
+ assert (p == null);
+ assert (e.code == FooError.BAD);
+ }
+}
+
+void main() {
+ var foo = new Foo ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]