Files
MSYS2-packages/glib2/2.16-tests.patch
2013-11-06 11:32:10 +04:00

121 lines
4.1 KiB
Diff

--- src/glib-2.38.1/tests/module-test.c.orig 2013-08-08 14:00:40.000000000 +0400
+++ src/glib-2.38.1/tests/module-test.c 2013-11-05 23:16:31.011200000 +0400
@@ -86,45 +86,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 ();
@@ -137,15 +144,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 ();
@@ -160,11 +167,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;
@@ -178,7 +185,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);
@@ -190,10 +197,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 ());
return 0;
}