11 #if defined (G_OS_WIN32)
12 #define EXTERNAL_SYMBOL "GetProcAddress"
14 #define EXTERNAL_SYMBOL "system"
22 /* test for g_module_open (NULL, ...) */
24 test_module_symbol_null ()
26 gpointer proc = GINT_TO_POINTER (42);
28 GModule *m = g_module_open (NULL, G_MODULE_BIND_LAZY);
31 return FAILED ("bind to main module failed. #0");
33 if (g_module_symbol (m, "__unlikely_\nexistent__", &proc))
34 return FAILED ("non-existent symbol lookup failed. #1");
37 return FAILED ("non-existent symbol lookup failed. #2");
39 if (!g_module_symbol (m, EXTERNAL_SYMBOL, &proc))
40 return FAILED ("external lookup failed. #3");
43 return FAILED ("external lookup failed. #4");
45 if (!g_module_symbol (m, "dummy_test_export", &proc))
46 return FAILED ("in-proc lookup failed. #5");
49 return FAILED ("in-proc lookup failed. #6");
51 if (!g_module_close (m))
52 return FAILED ("close failed. #7");
57 static Test module_tests [] = {
58 {"g_module_symbol_null", test_module_symbol_null},
62 DEFINE_TEST_GROUP_INIT(module_tests_init, module_tests)