121 lines
4.1 KiB
Diff
121 lines
4.1 KiB
Diff
--- src/glib-2.42.0/tests/module-test.c.orig 2014-07-05 08:59:10.000000000 +0900
|
|
+++ src/glib-2.42.0/tests/module-test.c 2014-09-25 17:31:23.619247700 +0900
|
|
@@ -84,45 +84,52 @@
|
|
if (!g_module_supported ())
|
|
g_error ("dynamic modules not supported");
|
|
|
|
- plugin_a = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_a", NULL);
|
|
- plugin_b = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_b", NULL);
|
|
+#ifdef G_WITH_CYGWIN
|
|
+#define PLUGIN_NAME ".libs/cygmoduletestplugin"
|
|
+#else
|
|
+#define PLUGIN_NAME "libmoduletestplugin"
|
|
+#endif
|
|
+ plugin_a = g_test_build_filename (G_TEST_BUILT, PLUGIN_NAME "_a", NULL);
|
|
+ plugin_b = g_test_build_filename (G_TEST_BUILT, PLUGIN_NAME "_b", NULL);
|
|
|
|
/* module handles */
|
|
|
|
module_self = g_module_open (NULL, G_MODULE_BIND_LAZY);
|
|
if (!module_self)
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error1: %s", g_module_error ());
|
|
|
|
+#ifndef G_WITH_CYGWIN
|
|
if (!g_module_symbol (module_self, "g_module_close", (gpointer *) &f_self))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error2: %s", g_module_error ());
|
|
+#endif
|
|
|
|
module_a = g_module_open (plugin_a, G_MODULE_BIND_LAZY);
|
|
if (!module_a)
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error3: %s", g_module_error ());
|
|
|
|
module_b = g_module_open (plugin_b, G_MODULE_BIND_LAZY);
|
|
if (!module_b)
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error4: %s", g_module_error ());
|
|
|
|
/* get plugin state vars */
|
|
|
|
if (!g_module_symbol (module_a, "gplugin_a_state",
|
|
(gpointer *) &gplugin_a_state))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error5: %s", g_module_error ());
|
|
|
|
if (!g_module_symbol (module_b, "gplugin_b_state",
|
|
(gpointer *) &gplugin_b_state))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error6: %s", g_module_error ());
|
|
test_states (NULL, NULL, "check-init");
|
|
|
|
/* get plugin specific symbols and call them
|
|
*/
|
|
if (!g_module_symbol (module_a, "gplugin_a_func", (gpointer *) &f_a))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error7: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
if (!g_module_symbol (module_b, "gplugin_b_func", (gpointer *) &f_b))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error8: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
f_a ();
|
|
@@ -135,15 +142,15 @@
|
|
*/
|
|
|
|
if (!g_module_symbol (module_self, "g_clash_func", (gpointer *) &f_self))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error9: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
if (!g_module_symbol (module_a, "g_clash_func", (gpointer *) &f_a))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error10: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
if (!g_module_symbol (module_b, "g_clash_func", (gpointer *) &f_b))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error11: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
f_self ();
|
|
@@ -158,11 +165,11 @@
|
|
/* get and call clashing plugin functions */
|
|
|
|
if (!g_module_symbol (module_a, "gplugin_clash_func", (gpointer *) &f_a))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error12: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
if (!g_module_symbol (module_b, "gplugin_clash_func", (gpointer *) &f_b))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error13: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
plugin_clash_func = f_a;
|
|
@@ -176,7 +183,7 @@
|
|
/* call gmodule function from A */
|
|
|
|
if (!g_module_symbol (module_a, "gplugin_a_module_func", (gpointer *) &gmod_f))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error14: %s", g_module_error ());
|
|
test_states (NULL, NULL, NULL);
|
|
|
|
gmod_f (module_b);
|
|
@@ -188,10 +195,10 @@
|
|
/* unload plugins */
|
|
|
|
if (!g_module_close (module_a))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error15: %s", g_module_error ());
|
|
|
|
if (!g_module_close (module_b))
|
|
- g_error ("error: %s", g_module_error ());
|
|
+ g_error ("error16: %s", g_module_error ());
|
|
|
|
g_free (plugin_a);
|
|
g_free (plugin_b);
|