From 2f6616431ebe09cbee6803419fb134cf7cbbefd1 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sat, 23 Feb 2019 20:19:31 +0100 Subject: [PATCH] tests: Add "ModuleInit" test to increase coverage --- tests/Makefile.am | 1 + tests/objects/plugin-module-init.vala | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/objects/plugin-module-init.vala diff --git a/tests/Makefile.am b/tests/Makefile.am index 178b897dc..4b6bf8de8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -280,6 +280,7 @@ TESTS = \ objects/interface-generics.vala \ objects/methods.vala \ objects/paramspec.vala \ + objects/plugin-module-init.vala \ objects/properties.vala \ objects/property-notify.vala \ objects/property-read-only-auto.vala \ diff --git a/tests/objects/plugin-module-init.vala b/tests/objects/plugin-module-init.vala new file mode 100644 index 000000000..959991187 --- /dev/null +++ b/tests/objects/plugin-module-init.vala @@ -0,0 +1,14 @@ +public class Module : GLib.TypeModule { + int private_field = 42; +} + +[ModuleInit] +public GLib.Type init_plugin (TypeModule? m) { + return typeof (Module); +} + +void main () { + var o = GLib.Object.new (init_plugin (null)); + assert (o is TypeModule); + assert (o is Module); +} -- 2.47.2