libnm: downgrade assertions in _nm_register_setting_impl() to nm_assert()

This is entirely internal API. We have unit tests that execute these
code paths. No need to have these assertions in production code.
This commit is contained in:
Thomas Haller
2017-06-01 14:31:25 +02:00
parent 837a8c1ca5
commit 1d6b717401

View File

@@ -132,22 +132,17 @@ _nm_register_setting_impl (const char *name,
{ {
SettingInfo *info; SettingInfo *info;
g_return_if_fail (name != NULL && *name); nm_assert (name && *name);
g_return_if_fail (type != G_TYPE_INVALID); nm_assert (!NM_IN_SET (type, G_TYPE_INVALID, G_TYPE_NONE));
g_return_if_fail (type != G_TYPE_NONE); nm_assert (priority != NM_SETTING_PRIORITY_INVALID);
_ensure_registered (); _ensure_registered ();
if (G_LIKELY ((info = g_hash_table_lookup (registered_settings, name)))) { nm_assert (!g_hash_table_lookup (registered_settings, name));
g_return_if_fail (info->type == type); nm_assert (!g_hash_table_lookup (registered_settings_by_type, &type));
g_return_if_fail (info->priority == priority);
g_return_if_fail (g_strcmp0 (info->name, name) == 0);
return;
}
g_return_if_fail (g_hash_table_lookup (registered_settings_by_type, &type) == NULL);
if (priority == NM_SETTING_PRIORITY_CONNECTION) nm_assert ( priority != NM_SETTING_PRIORITY_CONNECTION
g_assert_cmpstr (name, ==, NM_SETTING_CONNECTION_SETTING_NAME); || nm_streq (name, NM_SETTING_CONNECTION_SETTING_NAME));
info = g_slice_new0 (SettingInfo); info = g_slice_new0 (SettingInfo);
info->type = type; info->type = type;