summaryrefslogtreecommitdiff
path: root/libnm-core
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-01-02 15:47:37 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-01-18 11:45:36 +0100
commit8a46b25cfa8c33daa8af37bb8103ca02286001b1 (patch)
tree1725f84d8c42af42d1153aeaa71e63be8854bc93 /libnm-core
parent1443bf77e8cefc6f2d49f1e7f4140155ad73551b (diff)
downloadNetworkManager-lr/glib-2-40.tar.gz
all: require glib 2.40lr/glib-2-40
RHEL 7.1 and Ubuntu 14.04 LTS both have this. https://bugzilla.gnome.org/show_bug.cgi?id=792323
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/nm-setting-private.h2
-rw-r--r--libnm-core/nm-setting.c3
-rw-r--r--libnm-core/nm-utils.c2
-rw-r--r--libnm-core/tests/test-general.c62
4 files changed, 2 insertions, 67 deletions
diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h
index 1e926a66e1..6c50178d64 100644
--- a/libnm-core/nm-setting-private.h
+++ b/libnm-core/nm-setting-private.h
@@ -89,7 +89,7 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting,
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
-{ nm_g_type_init (); g_type_ensure (x); }
+{ g_type_ensure (x); }
GVariant *_nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting,
NMConnection *connection,
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index 5a06fd062b..4c76ed3199 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -94,7 +94,6 @@ static void
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
- nm_g_type_init ();
registered_settings = g_hash_table_new (nm_str_hash, g_str_equal);
registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
}
@@ -816,7 +815,7 @@ _nm_setting_new_from_dbus (GType setting_type,
g_variant_unref (entry_key);
g_variant_unref (entry);
- if (!nm_g_hash_table_add (keys, key)) {
+ if (!g_hash_table_add (keys, key)) {
g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING,
_("duplicate property"));
g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), key);
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index efb8a9befb..910dfc94f3 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -253,8 +253,6 @@ _nm_utils_init (void)
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- nm_g_type_init ();
-
_nm_dbus_errors_init ();
}
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index 9cf08c5d8c..544eb3c06d 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -6093,66 +6093,6 @@ again:
/*****************************************************************************/
-static void
-test_g_ptr_array_insert (void)
-{
- /* this test only makes sense on a recent glib, where we compare our compat
- * with the original implementation. */
-#if GLIB_CHECK_VERSION(2, 40, 0)
- gs_unref_ptrarray GPtrArray *arr1 = g_ptr_array_new ();
- gs_unref_ptrarray GPtrArray *arr2 = g_ptr_array_new ();
- GRand *rand = nmtst_get_rand ();
- guint i;
-
- for (i = 0; i < 560; i++) {
- gint32 idx = g_rand_int_range (rand, -1, arr1->len + 1);
-
- g_ptr_array_insert (arr1, idx, GINT_TO_POINTER (i));
- _nm_g_ptr_array_insert (arr2, idx, GINT_TO_POINTER (i));
-
- g_assert_cmpint (arr1->len, ==, arr2->len);
- g_assert (memcmp (arr1->pdata, arr2->pdata, arr1->len * sizeof (gpointer)) == 0);
- }
-#endif
-}
-
-/*****************************************************************************/
-
-static void
-test_g_hash_table_get_keys_as_array (void)
-{
- GHashTable *table = g_hash_table_new (nm_str_hash, g_str_equal);
- guint length = 0;
- char **keys;
-
- g_hash_table_insert (table, "one", "1");
- g_hash_table_insert (table, "two", "2");
- g_hash_table_insert (table, "three", "3");
-
- keys = (char **) _nm_g_hash_table_get_keys_as_array (table, &length);
- g_assert (keys);
- g_assert_cmpuint (length, ==, 3);
-
- g_assert ( !strcmp (keys[0], "one")
- || !strcmp (keys[1], "one")
- || !strcmp (keys[2], "one"));
-
- g_assert ( !strcmp (keys[0], "two")
- || !strcmp (keys[1], "two")
- || !strcmp (keys[2], "two"));
-
- g_assert ( !strcmp (keys[0], "three")
- || !strcmp (keys[1], "three")
- || !strcmp (keys[2], "three"));
-
- g_assert (!keys[3]);
-
- g_free (keys);
- g_hash_table_unref (table);
-}
-
-/*****************************************************************************/
-
static int
_test_find_binary_search_cmp (gconstpointer a, gconstpointer b, gpointer dummy)
{
@@ -7074,8 +7014,6 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
g_test_add_func ("/core/general/nm_utils_is_power_of_two", test_nm_utils_is_power_of_two);
- g_test_add_func ("/core/general/_glib_compat_g_ptr_array_insert", test_g_ptr_array_insert);
- g_test_add_func ("/core/general/_glib_compat_g_hash_table_get_keys_as_array", test_g_hash_table_get_keys_as_array);
g_test_add_func ("/core/general/_nm_utils_ptrarray_find_binary_search", test_nm_utils_ptrarray_find_binary_search);
g_test_add_func ("/core/general/_nm_utils_ptrarray_find_binary_search_with_duplicates", test_nm_utils_ptrarray_find_binary_search_with_duplicates);
g_test_add_func ("/core/general/_nm_utils_strstrdictkey", test_nm_utils_strstrdictkey);