diff options
author | Garrett Regier <garrettregier@gmail.com> | 2014-12-18 06:14:14 -0800 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2014-12-18 06:14:14 -0800 |
commit | 1f7655890c7b38e0b172b2d9f350142675a3dc6c (patch) | |
tree | 5dc63d08d8d9613a72707a5bb885e6320c04c823 /libpeas/peas-object-module.c | |
parent | f766cdf142f109e573293fa8be4f8362fb21811a (diff) | |
download | libpeas-1f7655890c7b38e0b172b2d9f350142675a3dc6c.tar.gz |
Fix the test suite to work on other operating systems
Change the warnings so they can be checked properly in
the tests without relying on OS specific messages.
https://bugzilla.gnome.org/show_bug.cgi?id=727380
Diffstat (limited to 'libpeas/peas-object-module.c')
-rw-r--r-- | libpeas/peas-object-module.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c index b556575..1f36ec7 100644 --- a/libpeas/peas-object-module.c +++ b/libpeas/peas-object-module.c @@ -90,11 +90,12 @@ peas_object_module_load (GTypeModule *gmodule) path = g_module_build_path (module->priv->path, module->priv->module_name); g_return_val_if_fail (path != NULL, FALSE); - /* g_module_build_path() will add G_MODULE_SUFFIX to the path, but otoh - * g_module_open() will only try to load the libtool archive if there is no - * suffix specified. So we remove G_MODULE_SUFFIX here (this allows - * uninstalled builds to load plugins as well, as there is only the .la file - * in the build directory) */ + /* g_module_build_path() will add G_MODULE_SUFFIX to the path, + * however g_module_open() will only try to load the libtool archive + * if there is no suffix specified. So we remove G_MODULE_SUFFIX here + * which allows uninstalled builds to load plugins as well, as there + * is only the .la file in the build directory. + */ if (G_MODULE_SUFFIX[0] != '\0' && g_str_has_suffix (path, "." G_MODULE_SUFFIX)) path[strlen (path) - strlen (G_MODULE_SUFFIX) - 1] = '\0'; @@ -104,27 +105,30 @@ peas_object_module_load (GTypeModule *gmodule) if (module->priv->library == NULL) { - g_warning ("%s: %s", module->priv->module_name, g_module_error ()); + g_warning ("Failed to load module '%s': %s", + module->priv->module_name, g_module_error ()); return FALSE; } - /* extract symbols from the lib */ + /* Extract the required symbol from the library */ if (!g_module_symbol (module->priv->library, "peas_register_types", - (void *) &module->priv->register_func)) + (gpointer) &module->priv->register_func)) { - g_warning ("%s: %s", module->priv->module_name, g_module_error ()); + g_warning ("Failed to get 'peas_register_types' for module '%s': %s", + module->priv->module_name, g_module_error ()); g_module_close (module->priv->library); return FALSE; } - /* symbol can still be NULL even though g_module_symbol - * returned TRUE */ + /* The symbol can still be NULL even + * though g_module_symbol() returned TRUE + */ if (module->priv->register_func == NULL) { - g_warning ("%s: Symbol 'peas_register_types' is not defined", + g_warning ("Invalid 'peas_register_types' in module '%s'", module->priv->module_name); g_module_close (module->priv->library); |