From: Rico Tzschichholz Date: Sat, 23 Feb 2019 19:19:31 +0000 (+0100) Subject: tests: Add "ModuleInit" test to increase coverage X-Git-Tag: 0.43.92~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f6616431ebe09cbee6803419fb134cf7cbbefd1;p=thirdparty%2Fvala.git tests: Add "ModuleInit" test to increase coverage --- 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); +}