[vala/staging: 5/10] tests: Add "ModuleInit" test to increase coverage



commit 2f6616431ebe09cbee6803419fb134cf7cbbefd1
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Feb 23 20:19:31 2019 +0100

    tests: Add "ModuleInit" test to increase coverage

 tests/Makefile.am                     |  1 +
 tests/objects/plugin-module-init.vala | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
---
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);
+}


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