]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dbus: increase code coverage tintou/dbus-coverage 0aa0628ce9e50b6952995a94bcc737c3ae19c081 121/head
authorCorentin Noël <corentin@elementary.io>
Sat, 4 Apr 2020 15:05:52 +0000 (17:05 +0200)
committerCorentin Noël <corentin@elementary.io>
Sat, 4 Apr 2020 15:05:52 +0000 (17:05 +0200)
Add test for multiple signals generation, private signals, signals with arrays and plugins.

tests/Makefile.am
tests/dbus/multiple-signals.vala [new file with mode: 0644]
tests/dbus/plugin.vala [new file with mode: 0644]

index 9f956d793ab5d089b4af2c991c74d66192e0c076..01bf9e1528762b56aa2f5aef632f27096fc5faad 100644 (file)
@@ -588,6 +588,8 @@ TESTS = \
        dbus/bug783002.test \
        dbus/bug792277.vala \
        dbus/rawvariants.test \
+       dbus/plugin.vala \
+       dbus/multiple-signals.vala \
        gir/bug651773.test \
        gir/bug667751.test \
        gir/bug742012.test \
diff --git a/tests/dbus/multiple-signals.vala b/tests/dbus/multiple-signals.vala
new file mode 100644 (file)
index 0000000..a11d0bc
--- /dev/null
@@ -0,0 +1,10 @@
+[DBus (name = "org.example.Test")]
+public interface Foo : GLib.Object {
+       private signal void test1 ();
+       public signal void test2 ();
+       public signal void test3 (int[] test);
+}
+
+void main () {
+       
+}
diff --git a/tests/dbus/plugin.vala b/tests/dbus/plugin.vala
new file mode 100644 (file)
index 0000000..56f1e2f
--- /dev/null
@@ -0,0 +1,19 @@
+[ModuleInit]
+public GLib.Type init_plugin (TypeModule? m) {
+       return typeof (Foo);
+}
+
+[DBus (name = "org.example.Test")]
+public interface Foo : GLib.TypeModule {
+       public void do_foo (Variant value) {
+       }
+}
+
+void main () {
+// https://bugzilla.gnome.org/show_bug.cgi?id=684282
+#if GLIB_2_56
+       var o = GLib.Object.new (init_plugin (null));
+       assert (o is TypeModule);
+       assert (o is Foo);
+#endif
+}