8 #if defined (G_OS_WIN32)
9 #define EXTERNAL_SYMBOL "GetProcAddress"
11 #define EXTERNAL_SYMBOL "system"
19 /* test for g_module_open (NULL, ...) */
21 test_module_symbol_null ()
23 gpointer proc = GINT_TO_POINTER (42);
25 GModule *m = g_module_open (NULL, G_MODULE_BIND_LAZY);
28 return FAILED ("bind to main module failed. #0");
30 if (g_module_symbol (m, "__unlikely_\nexistent__", &proc))
31 return FAILED ("non-existent symbol lookup failed. #1");
34 return FAILED ("non-existent symbol lookup failed. #2");
36 if (!g_module_symbol (m, EXTERNAL_SYMBOL, &proc))
37 return FAILED ("external lookup failed. #3");
40 return FAILED ("external lookup failed. #4");
42 if (!g_module_symbol (m, "dummy_test_export", &proc))
43 return FAILED ("in-proc lookup failed. #5");
46 return FAILED ("in-proc lookup failed. #6");
48 if (!g_module_close (m))
49 return FAILED ("close failed. #7");
54 static Test module_tests [] = {
55 {"g_module_symbol_null", test_module_symbol_null},
59 DEFINE_TEST_GROUP_INIT(module_tests_init, module_tests)