mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
gnc-module - fix incompatdep test
The test passed but for the wrong reasons: as no GNC_MODULE_PATH was passed to the test it just didn't find the module. That's different from finding a module with the same name but a wrong sysver. This commit fixes that.
This commit is contained in:
@@ -531,7 +531,7 @@ gnc_module_load_common(const char * module_name, gint iface, gboolean optional)
|
||||
if (!info->init_func(0))
|
||||
{
|
||||
/* init failed. unload the module. */
|
||||
g_warning ("Initialization failed for module %s\n", module_name);
|
||||
g_warning ("Initialization failed for module %s", module_name);
|
||||
g_hash_table_remove(loaded_modules, info);
|
||||
g_free(info->filename);
|
||||
g_free(info);
|
||||
|
||||
@@ -24,7 +24,8 @@ gnc_add_test(test-load-c
|
||||
test-load-c.c
|
||||
GNC_MODULE_TEST_INCLUDE_DIRS
|
||||
GNC_MODULE_TEST_LIBS
|
||||
"GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
|
||||
"GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
|
||||
)
|
||||
|
||||
gnc_add_test(test-modsysver
|
||||
test-modsysver.c
|
||||
@@ -36,6 +37,7 @@ gnc_add_test(test-incompatdep
|
||||
test-incompatdep.c
|
||||
GNC_MODULE_TEST_INCLUDE_DIRS
|
||||
GNC_MODULE_TEST_LIBS
|
||||
"GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
|
||||
)
|
||||
gnc_add_test(test-agedver
|
||||
test-agedver.c
|
||||
|
||||
@@ -29,20 +29,20 @@ int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
GNCModule foo;
|
||||
gchar *msg = "Could not locate module gnucash/incompatdep interface v.0";
|
||||
gchar *logdomain = "gnc.module";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
test_add_error (&check);
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_list_handler, NULL);
|
||||
gchar *msg1 = "Could not locate module gnucash/ordinary interface v.25";
|
||||
gchar *msg2 = "Initialization failed for module gnucash/incompatdep";
|
||||
|
||||
g_test_message(" test-incompatdep.c: loading a module with bad deps ...\n");
|
||||
|
||||
g_test_expect_message ("gnc.module", G_LOG_LEVEL_WARNING, msg1);
|
||||
g_test_expect_message ("gnc.module", G_LOG_LEVEL_WARNING, msg2);
|
||||
|
||||
gnc_module_system_init();
|
||||
|
||||
foo = gnc_module_load("gnucash/incompatdep", 0);
|
||||
|
||||
g_test_assert_expected_messages();
|
||||
|
||||
if (!foo)
|
||||
{
|
||||
printf(" ok\n");
|
||||
|
||||
Reference in New Issue
Block a user