diff options
-rw-r--r-- | src/tests/config/test-config.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c index fc73d5bdd0..453894dcd1 100644 --- a/src/tests/config/test-config.c +++ b/src/tests/config/test-config.c @@ -289,28 +289,18 @@ test_config_confdir_parse_error (void) NMTST_DEFINE (); - -static void -ignore_log (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) -{ -} - int main (int argc, char **argv) { - /* Initialize the DBus manager singleton in advance, ignoring the warnings. - * Otherwise it would attempt to initialize as soon as nm_test_device_new() - * would cause NMDevice class to register its type on the bus. We don't care - * about that and the warnings would mess up with the testing. - * */ - g_log_set_default_handler (ignore_log, NULL); - nm_dbus_manager_get (); - nmtst_init_assert_logging (&argc, &argv); + /* Initialize the DBus manager singleton because it is accessed by the + * class initializer of NMDevice (which is used by our NMTestDevice stub). + * This way, we skip calling nm_dbus_manager_init_bus() which would + * either fail and/or cause unexpected actions in the test. + * */ + nm_dbus_manager_setup (g_object_new (NM_TYPE_DBUS_MANAGER, NULL)); + nm_fake_platform_setup (); g_test_add_func ("/config/simple", test_config_simple); |