diff options
Diffstat (limited to 'libnm-util')
| -rw-r--r-- | libnm-util/meson.build | 194 | ||||
| -rw-r--r-- | libnm-util/nm-param-spec-specialized.c | 2 | ||||
| -rw-r--r-- | libnm-util/nm-setting-private.h | 2 | ||||
| -rw-r--r-- | libnm-util/nm-setting-wired.c | 2 | ||||
| -rw-r--r-- | libnm-util/nm-setting.c | 1 | ||||
| -rw-r--r-- | libnm-util/nm-utils-enum-types.c.template | 65 | ||||
| -rw-r--r-- | libnm-util/nm-utils-enum-types.h.template | 21 | ||||
| -rw-r--r-- | libnm-util/nm-utils.c | 68 | ||||
| -rw-r--r-- | libnm-util/nm-version.h | 8 | ||||
| -rw-r--r-- | libnm-util/tests/meson.build | 47 | ||||
| -rw-r--r-- | libnm-util/tests/test-general.c | 103 | ||||
| -rw-r--r-- | libnm-util/tests/test-setting-dcb.c | 10 |
12 files changed, 99 insertions, 424 deletions
diff --git a/libnm-util/meson.build b/libnm-util/meson.build deleted file mode 100644 index b385e32b..00000000 --- a/libnm-util/meson.build +++ /dev/null @@ -1,194 +0,0 @@ -libnm_util_inc = include_directories('.') - -enums_headers = [version_header] + files( - 'nm-connection.h', - 'nm-setting-8021x.h', - 'nm-setting-adsl.h', - 'nm-setting-bluetooth.h', - 'nm-setting-bond.h', - 'nm-setting-bridge.h', - 'nm-setting-bridge-port.h', - 'nm-setting-cdma.h', - 'nm-setting-connection.h', - 'nm-setting-dcb.h', - 'nm-setting-generic.h', - 'nm-setting-gsm.h', - 'nm-setting.h', - 'nm-setting-infiniband.h', - 'nm-setting-ip4-config.h', - 'nm-setting-ip6-config.h', - 'nm-setting-olpc-mesh.h', - 'nm-setting-ppp.h', - 'nm-setting-pppoe.h', - 'nm-setting-serial.h', - 'nm-setting-team.h', - 'nm-setting-team-port.h', - 'nm-setting-vlan.h', - 'nm-setting-vpn.h', - 'nm-setting-wimax.h', - 'nm-setting-wired.h', - 'nm-setting-wireless.h', - 'nm-setting-wireless-security.h', - 'nm-utils.h', - 'nm-version.h' -) - -headers = enums_headers + files( - 'NetworkManager.h', - 'NetworkManagerVPN.h' -) - -install_headers( - headers, - subdir: nm_name -) - -enum_types = 'nm-utils-enum-types' - -libnm_utils_enum = gnome.mkenums( - enum_types, - sources: enums_headers, - identifier_prefix: nm_id_prefix, - c_template: enum_types + '.c.template', - h_template: enum_types + '.h.template', - install_header: true, - install_dir: nm_pkgincludedir -) - -sources = shared_utils + files( - 'crypto.c', - 'crypto_' + crypto + '.c', - 'nm-connection.c', - 'nm-param-spec-specialized.c', - 'nm-setting-8021x.c', - 'nm-setting-adsl.c', - 'nm-setting-bluetooth.c', - 'nm-setting-bridge.c', - 'nm-setting-bridge-port.c', - 'nm-setting-bond.c', - 'nm-setting.c', - 'nm-setting-cdma.c', - 'nm-setting-connection.c', - 'nm-setting-dcb.c', - 'nm-setting-generic.c', - 'nm-setting-gsm.c', - 'nm-setting-infiniband.c', - 'nm-setting-ip4-config.c', - 'nm-setting-ip6-config.c', - 'nm-setting-olpc-mesh.c', - 'nm-setting-ppp.c', - 'nm-setting-pppoe.c', - 'nm-setting-serial.c', - 'nm-setting-team.c', - 'nm-setting-team-port.c', - 'nm-setting-wimax.c', - 'nm-setting-wired.c', - 'nm-setting-wireless.c', - 'nm-setting-wireless-security.c', - 'nm-setting-vlan.c', - 'nm-setting-vpn.c', - 'nm-utils.c', - 'nm-value-transforms.c' -) - -deps = [ - crypto_dep, - dbus_dep, - dbus_glib_dep, - shared_dep, - uuid_dep -] - -common_cflags = [ - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL', - '-DLOCALEDIR="@0@"'.format(nm_localedir), -] - -cflags = common_cflags + [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_util_name) -] - -linker_script = join_paths(meson.current_source_dir(), 'libnm-util.ver') - -libnm_util = shared_library( - 'nm-util', - sources: sources + libnm_utils_enum, - version: libnm_util_version, - dependencies: deps, - c_args: cflags, - link_args: [ - '-Wl,--version-script,@0@'.format(linker_script), - ], - link_depends: linker_script, - install: true -) - -libnm_util_dep = declare_dependency( - sources: libnm_utils_enum[1], - include_directories: libnm_util_inc, - link_with: libnm_util -) - -pkg.generate( - libraries: libnm_util, - version: nm_version, - name: libnm_util_name, - description: 'Convenience library for clients of NetworkManager', - filebase: libnm_util_name, - subdirs: nm_name, - requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1', - variables: 'exec_prefix=${prefix}' -) - -if enable_introspection - gir_sources = sources + headers + libnm_utils_enum - - gir_includes = [ - 'DBusGLib-1.0', - 'GObject-2.0' - ] - - libnm_util_gir = gnome.generate_gir( - libnm_util, - sources: gir_sources, - nsversion: nm_gir_version, - namespace: nm_name, - identifier_prefix: nm_id_prefix, - symbol_prefix: nm_id_prefix.to_lower(), - export_packages: libnm_util_name, - includes: gir_includes, - install: true - ) - - libnm_util_gir_dep = declare_dependency( - sources: libnm_util_gir, - link_with: libnm_util - ) -endif - -run_target( - 'check-local-exports-' + libnm_util_name, - command: [check_exports, libnm_util.full_path(), linker_script], - depends: libnm_util -) - -sources = files( - 'crypto.c', - 'crypto_' + crypto + '.c' -) - -deps = [ - crypto_dep, - shared_dep -] - -libtest_crypto = static_library( - 'test-crypto', - sources: sources, - dependencies: deps, - c_args: cflags -) - -if enable_tests - subdir('tests') -endif diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index fc8d0318..a4e01d8f 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -956,6 +956,8 @@ main (int argc, char *argv[]) { DBusGConnection *bus; + nm_g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); compare_ints (); diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index db5f3afa..ba15a238 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -105,7 +105,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) \ -{ g_type_ensure (x); } +{ nm_g_type_init (); g_type_ensure (x); } NMSetting *nm_setting_find_in_list (GSList *settings_list, const char *setting_name); diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 4296d511..85ba0f5e 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -947,7 +947,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS)); - + /** * NMSettingWired:mac-address-blacklist: * diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 760b3cac..3bcefbc5 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -102,6 +102,7 @@ static void _ensure_registered (void) { if (G_UNLIKELY (registered_settings == NULL)) { + nm_g_type_init (); _nm_value_transforms_register (); registered_settings = g_hash_table_new (g_str_hash, g_str_equal); registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal); diff --git a/libnm-util/nm-utils-enum-types.c.template b/libnm-util/nm-utils-enum-types.c.template deleted file mode 100644 index e6505d34..00000000 --- a/libnm-util/nm-utils-enum-types.c.template +++ /dev/null @@ -1,65 +0,0 @@ -/*** BEGIN file-header ***/ -#include "config.h" - -#include "nm-utils-enum-types.h" - -#include "nm-version-macros.h" -#include "nm-connection.h" -#include "nm-setting.h" -#include "nm-setting-8021x.h" -#include "nm-setting-adsl.h" -#include "nm-setting-bluetooth.h" -#include "nm-setting-bond.h" -#include "nm-setting-team.h" -#include "nm-setting-team-port.h" -#include "nm-setting-bridge.h" -#include "nm-setting-bridge-port.h" -#include "nm-setting-connection.h" -#include "nm-setting-dcb.h" -#include "nm-setting-infiniband.h" -#include "nm-setting-ip4-config.h" -#include "nm-setting-vlan.h" -#include "nm-setting-ip6-config.h" -#include "nm-setting-ppp.h" -#include "nm-setting-pppoe.h" -#include "nm-setting-serial.h" -#include "nm-setting-generic.h" -#include "nm-setting-gsm.h" -#include "nm-setting-cdma.h" -#include "nm-setting-olpc-mesh.h" -#include "nm-setting-wimax.h" -#include "nm-setting-wired.h" -#include "nm-setting-wireless.h" -#include "nm-setting-wireless-security.h" -#include "nm-setting-vpn.h" -#include "nm-utils.h" -#include "nm-version.h" -/*** END file-header ***/ - -/*** BEGIN value-header ***/ -GType -@enum_name@_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - static const G@Type@Value values[] = { -/*** END value-header ***/ - -/*** BEGIN value-production ***/ - { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, -/*** END value-production ***/ - -/*** BEGIN value-tail ***/ - { 0, NULL, NULL } - }; - GType g_define_type_id = - g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } - - return g_define_type_id__volatile; -} - -/*** END value-tail ***/ diff --git a/libnm-util/nm-utils-enum-types.h.template b/libnm-util/nm-utils-enum-types.h.template deleted file mode 100644 index ac0cc3c8..00000000 --- a/libnm-util/nm-utils-enum-types.h.template +++ /dev/null @@ -1,21 +0,0 @@ -/*** BEGIN file-header ***/ -#ifndef __NM_UTILS_ENUM_TYPES_H__ -#define __NM_UTILS_ENUM_TYPES_H__ - -#include <glib-object.h> - -G_BEGIN_DECLS - -/*** END file-header ***/ - -/*** BEGIN enumeration-production ***/ -GType @enum_name@_get_type (void) G_GNUC_CONST; -#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) - -/*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -G_END_DECLS - -#endif /* __NM_UTILS_ENUM_TYPES_H__ */ -/*** END file-tail ***/ diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 5d80b2a4..9330aaaa 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -55,7 +55,7 @@ struct EncodingTriplet struct IsoLangToEncodings { - const char *lang; + const char * lang; struct EncodingTriplet encodings; }; @@ -63,13 +63,13 @@ struct IsoLangToEncodings static const struct IsoLangToEncodings isoLangEntries5[] = { /* Simplified Chinese */ - { "zh_cn", {"euc-cn", "gb2312", "gb18030"} }, /* PRC */ - { "zh_sg", {"euc-cn", "gb2312", "gb18030"} }, /* Singapore */ + { "zh_cn", {"euc-cn", "gb2312", "gb18030"} }, /* PRC */ + { "zh_sg", {"euc-cn", "gb2312", "gb18030"} }, /* Singapore */ /* Traditional Chinese */ - { "zh_tw", {"big5", "euc-tw", NULL} }, /* Taiwan */ - { "zh_hk", {"big5", "euc-tw", "big5-hkcs"} },/* Hong Kong */ - { "zh_mo", {"big5", "euc-tw", NULL} }, /* Macau */ + { "zh_tw", {"big5", "euc-tw", NULL} }, /* Taiwan */ + { "zh_hk", {"big5", "euc-tw", "big5-hkcs"} },/* Hong Kong */ + { "zh_mo", {"big5", "euc-tw", NULL} }, /* Macau */ /* Table end */ { NULL, {NULL, NULL, NULL} } @@ -79,49 +79,49 @@ static const struct IsoLangToEncodings isoLangEntries5[] = static const struct IsoLangToEncodings isoLangEntries2[] = { /* Japanese */ - { "ja", {"euc-jp", "shift_jis", "iso-2022-jp"} }, + { "ja", {"euc-jp", "shift_jis", "iso-2022-jp"} }, /* Korean */ - { "ko", {"euc-kr", "iso-2022-kr", "johab"} }, + { "ko", {"euc-kr", "iso-2022-kr", "johab"} }, /* Thai */ - { "th", {"iso-8859-11","windows-874", NULL} }, + { "th", {"iso-8859-11","windows-874", NULL} }, /* Central European */ - { "hu", {"iso-8859-2", "windows-1250", NULL} }, /* Hungarian */ - { "cs", {"iso-8859-2", "windows-1250", NULL} }, /* Czech */ - { "hr", {"iso-8859-2", "windows-1250", NULL} }, /* Croatian */ - { "pl", {"iso-8859-2", "windows-1250", NULL} }, /* Polish */ - { "ro", {"iso-8859-2", "windows-1250", NULL} }, /* Romanian */ - { "sk", {"iso-8859-2", "windows-1250", NULL} }, /* Slovakian */ - { "sl", {"iso-8859-2", "windows-1250", NULL} }, /* Slovenian */ - { "sh", {"iso-8859-2", "windows-1250", NULL} }, /* Serbo-Croatian */ + { "hu", {"iso-8859-2", "windows-1250", NULL} }, /* Hungarian */ + { "cs", {"iso-8859-2", "windows-1250", NULL} }, /* Czech */ + { "hr", {"iso-8859-2", "windows-1250", NULL} }, /* Croatian */ + { "pl", {"iso-8859-2", "windows-1250", NULL} }, /* Polish */ + { "ro", {"iso-8859-2", "windows-1250", NULL} }, /* Romanian */ + { "sk", {"iso-8859-2", "windows-1250", NULL} }, /* Slovakian */ + { "sl", {"iso-8859-2", "windows-1250", NULL} }, /* Slovenian */ + { "sh", {"iso-8859-2", "windows-1250", NULL} }, /* Serbo-Croatian */ /* Cyrillic */ - { "ru", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Russian */ - { "be", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Belorussian */ - { "bg", {"windows-1251","koi8-r", "iso-8859-5"} }, /* Bulgarian */ - { "mk", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Macedonian */ - { "sr", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Serbian */ - { "uk", {"koi8-u", "koi8-r", "windows-1251"} }, /* Ukranian */ + { "ru", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Russian */ + { "be", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Belorussian */ + { "bg", {"windows-1251","koi8-r", "iso-8859-5"} }, /* Bulgarian */ + { "mk", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Macedonian */ + { "sr", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Serbian */ + { "uk", {"koi8-u", "koi8-r", "windows-1251"} }, /* Ukranian */ /* Arabic */ - { "ar", {"iso-8859-6", "windows-1256", NULL} }, + { "ar", {"iso-8859-6", "windows-1256", NULL} }, /* Baltic */ - { "et", {"iso-8859-4", "windows-1257", NULL} }, /* Estonian */ - { "lt", {"iso-8859-4", "windows-1257", NULL} }, /* Lithuanian */ - { "lv", {"iso-8859-4", "windows-1257", NULL} }, /* Latvian */ + { "et", {"iso-8859-4", "windows-1257", NULL} }, /* Estonian */ + { "lt", {"iso-8859-4", "windows-1257", NULL} }, /* Lithuanian */ + { "lv", {"iso-8859-4", "windows-1257", NULL} }, /* Latvian */ /* Greek */ - { "el", {"iso-8859-7", "windows-1253", NULL} }, + { "el", {"iso-8859-7", "windows-1253", NULL} }, /* Hebrew */ - { "he", {"iso-8859-8", "windows-1255", NULL} }, - { "iw", {"iso-8859-8", "windows-1255", NULL} }, + { "he", {"iso-8859-8", "windows-1255", NULL} }, + { "iw", {"iso-8859-8", "windows-1255", NULL} }, /* Turkish */ - { "tr", {"iso-8859-9", "windows-1254", NULL} }, + { "tr", {"iso-8859-9", "windows-1254", NULL} }, /* Table end */ { NULL, {NULL, NULL, NULL} } @@ -166,9 +166,9 @@ get_encodings_for_lang (const char *lang, char **encoding2, char **encoding3) { - struct EncodingTriplet *encodings; - gboolean success = FALSE; - char *tmp_lang; + struct EncodingTriplet * encodings; + gboolean success = FALSE; + char * tmp_lang; g_return_val_if_fail (lang != NULL, FALSE); g_return_val_if_fail (encoding1 != NULL, FALSE); diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h index f56c3944..7173bc6b 100644 --- a/libnm-util/nm-version.h +++ b/libnm-util/nm-version.h @@ -29,17 +29,17 @@ #if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0) # undef NM_VERSION_MIN_REQUIRED -# define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) +# define NM_VERSION_MIN_REQUIRED (NM_VERSION_CUR_STABLE) #endif #if !defined (NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0) # undef NM_VERSION_MAX_ALLOWED -# define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) +# define NM_VERSION_MAX_ALLOWED (NM_VERSION_CUR_STABLE) #endif /* sanity checks */ -#if NM_VERSION_MIN_REQUIRED > NM_API_VERSION -#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" +#if NM_VERSION_MIN_REQUIRED > NM_VERSION_NEXT_STABLE +#error "NM_VERSION_MIN_REQUIRED must be <= NM_VERSION_NEXT_STABLE" #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED #error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" diff --git a/libnm-util/tests/meson.build b/libnm-util/tests/meson.build deleted file mode 100644 index 63535033..00000000 --- a/libnm-util/tests/meson.build +++ /dev/null @@ -1,47 +0,0 @@ -deps = [ - dbus_dep, - dbus_glib_dep, - libnm_util_dep, - shared_dep -] - -cflags = common_cflags + [ - '-DBUILD_DIR="@0@"'.format(meson.current_build_dir()), - '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir), - '-DNETWORKMANAGER_COMPILATION_TEST', -] - -test = 'test-libnm-linking' - -test_libnm_linking = executable( - test, - test + '.c', - dependencies: deps + [libnm_dep], - c_args: cflags -) - -test_units = [ - ['test-crypto', [libtest_crypto], []], - ['test-general', [], [test_libnm_linking]], - ['test-secrets', [], []], - ['test-setting-8021x', [], []], - ['test-setting-dcb', [], []], - ['test-settings-defaults', [], []] -] - -foreach test_unit: test_units - exe = executable( - 'libnm-util-' + test_unit[0], - test_unit[0] + '.c', - dependencies: deps, - c_args: cflags, - link_with: test_unit[1], - link_depends: test_unit[2] - ) - - test( - 'libnm-util/' + test_unit[0], - test_script, - args: test_args + [exe.full_path()] - ) -endforeach diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 74eb7cdd..daa94894 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -114,54 +114,54 @@ test_setting_vpn_items (void) nm_setting_vpn_remove_secret (s_vpn, "foobar4"); /* Try to add some blank values and make sure they are rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (key != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (key != NULL)); nm_setting_vpn_add_data_item (s_vpn, NULL, NULL); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (key) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (key) > 0)); nm_setting_vpn_add_data_item (s_vpn, "", ""); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (item != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (item != NULL)); nm_setting_vpn_add_data_item (s_vpn, "foobar1", NULL); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (item) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (item) > 0)); nm_setting_vpn_add_data_item (s_vpn, "foobar1", ""); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (key != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (key != NULL)); nm_setting_vpn_add_data_item (s_vpn, NULL, "blahblah1"); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (key) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (key) > 0)); nm_setting_vpn_add_data_item (s_vpn, "", "blahblah1"); g_test_assert_expected_messages (); nm_setting_vpn_foreach_data_item (s_vpn, vpn_check_empty_func, NULL); /* Try to add some blank secrets and make sure they are rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (key != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (key != NULL)); nm_setting_vpn_add_secret (s_vpn, NULL, NULL); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (key) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (key) > 0)); nm_setting_vpn_add_secret (s_vpn, "", ""); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (secret != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (secret != NULL)); nm_setting_vpn_add_secret (s_vpn, "foobar1", NULL); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (secret) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (secret) > 0)); nm_setting_vpn_add_secret (s_vpn, "foobar1", ""); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (key != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (key != NULL)); nm_setting_vpn_add_secret (s_vpn, NULL, "blahblah1"); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strlen (key) > 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strlen (key) > 0)); nm_setting_vpn_add_secret (s_vpn, "", "blahblah1"); g_test_assert_expected_messages (); @@ -864,47 +864,47 @@ test_setting_connection_permissions_helpers (void) s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); /* Ensure a bad [type] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strcmp (ptype, "user") == 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strcmp (ptype, "user") == 0)); success = nm_setting_connection_add_permission (s_con, "foobar", "blah", NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure a bad [type] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (ptype)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (ptype)); success = nm_setting_connection_add_permission (s_con, NULL, "blah", NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure a bad [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (uname)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (p != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (uname)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (p != NULL)); success = nm_setting_connection_add_permission (s_con, "user", NULL, NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure a bad [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (uname[0] != '\0')); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (p != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (uname[0] != '\0')); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (p != NULL)); success = nm_setting_connection_add_permission (s_con, "user", "", NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure an [item] with ':' is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strchr (uname, ':') == NULL)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (p != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strchr (uname, ':') == NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (p != NULL)); success = nm_setting_connection_add_permission (s_con, "user", "ad:asdf", NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure a non-UTF-8 [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (g_utf8_validate (uname, -1, NULL) == TRUE)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (p != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (g_utf8_validate (uname, -1, NULL) == TRUE)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (p != NULL)); success = nm_setting_connection_add_permission (s_con, "user", buf, NULL); g_test_assert_expected_messages (); g_assert (!success); /* Ensure a non-NULL [detail] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (detail == NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (detail == NULL)); success = nm_setting_connection_add_permission (s_con, "user", "dafasdf", "asdf"); g_test_assert_expected_messages (); g_assert (!success); @@ -975,56 +975,55 @@ test_setting_connection_permissions_property (void) s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); /* Ensure a bad [type] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strncmp (str, PERM_USER_PREFIX, strlen (PERM_USER_PREFIX)) == 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strncmp (str, PERM_USER_PREFIX, strlen (PERM_USER_PREFIX)) == 0)); add_permission_property (s_con, "foobar", "blah", -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a bad [type] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (strncmp (str, PERM_USER_PREFIX, strlen (PERM_USER_PREFIX)) == 0)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (strncmp (str, PERM_USER_PREFIX, strlen (PERM_USER_PREFIX)) == 0)); add_permission_property (s_con, NULL, "blah", -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a bad [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (last_colon > str)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (last_colon > str)); add_permission_property (s_con, "user", NULL, -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a bad [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (last_colon > str)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (last_colon > str)); add_permission_property (s_con, "user", "", -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure an [item] with ':' in the middle is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (str[i] != ':')); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (str[i] != ':')); add_permission_property (s_con, "user", "ad:asdf", -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure an [item] with ':' at the end is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (str[i] != ':')); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (str[i] != ':')); add_permission_property (s_con, "user", "adasdfaf:", -1, NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a non-UTF-8 [item] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (g_utf8_validate (str, -1, NULL) == TRUE)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (g_utf8_validate (str, -1, NULL) == TRUE)); add_permission_property (s_con, "user", buf, (int) sizeof (buf), NULL); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a non-NULL [detail] is rejected */ - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (*(last_colon + 1) == '\0')); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (*(last_colon + 1) == '\0')); add_permission_property (s_con, "user", "dafasdf", -1, "asdf"); g_test_assert_expected_messages (); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 0); /* Ensure a valid call results in success */ success = nm_setting_connection_add_permission (s_con, "user", TEST_UNAME, NULL); - g_assert (success); g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 1); check_permission (s_con, 0, TEST_UNAME); @@ -1867,7 +1866,7 @@ test_setting_connection_changed_signal (void) ASSERT_CHANGED (nm_setting_connection_add_permission (s_con, "user", "billsmith", NULL)); ASSERT_CHANGED (nm_setting_connection_remove_permission (s_con, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (iter != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (iter != NULL)); ASSERT_UNCHANGED (nm_setting_connection_remove_permission (s_con, 1)); g_test_assert_expected_messages (); @@ -1875,7 +1874,7 @@ test_setting_connection_changed_signal (void) ASSERT_CHANGED (nm_setting_connection_add_secondary (s_con, uuid)); ASSERT_CHANGED (nm_setting_connection_remove_secondary (s_con, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_connection_remove_secondary (s_con, 1)); g_test_assert_expected_messages (); @@ -1926,7 +1925,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip4_config_add_dns (s_ip4, 0x1122)); ASSERT_CHANGED (nm_setting_ip4_config_remove_dns (s_ip4, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (i <= priv->dns->len)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (i <= priv->dns->len)); ASSERT_UNCHANGED (nm_setting_ip4_config_remove_dns (s_ip4, 1)); g_test_assert_expected_messages (); @@ -1936,7 +1935,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip4_config_add_dns_search (s_ip4, "foobar.com")); ASSERT_CHANGED (nm_setting_ip4_config_remove_dns_search (s_ip4, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip4_config_remove_dns_search (s_ip4, 1)); g_test_assert_expected_messages (); @@ -1949,7 +1948,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip4_config_add_address (s_ip4, addr)); ASSERT_CHANGED (nm_setting_ip4_config_remove_address (s_ip4, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip4_config_remove_address (s_ip4, 1)); g_test_assert_expected_messages (); @@ -1963,7 +1962,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip4_config_add_route (s_ip4, route)); ASSERT_CHANGED (nm_setting_ip4_config_remove_route (s_ip4, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip4_config_remove_route (s_ip4, 1)); g_test_assert_expected_messages (); @@ -1997,7 +1996,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip6_config_add_dns (s_ip6, &t)); ASSERT_CHANGED (nm_setting_ip6_config_remove_dns (s_ip6, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip6_config_remove_dns (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2007,7 +2006,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip6_config_add_dns_search (s_ip6, "foobar.com")); ASSERT_CHANGED (nm_setting_ip6_config_remove_dns_search (s_ip6, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip6_config_remove_dns_search (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2021,7 +2020,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip6_config_add_address (s_ip6, addr)); ASSERT_CHANGED (nm_setting_ip6_config_remove_address (s_ip6, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip6_config_remove_address (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2035,7 +2034,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip6_config_add_route (s_ip6, route)); ASSERT_CHANGED (nm_setting_ip6_config_remove_route (s_ip6, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_ip6_config_remove_route (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2065,7 +2064,7 @@ test_setting_vlan_changed_signal (void) ASSERT_CHANGED (nm_setting_vlan_add_priority (s_vlan, NM_VLAN_INGRESS_MAP, 1, 3)); ASSERT_CHANGED (nm_setting_vlan_remove_priority (s_vlan, NM_VLAN_INGRESS_MAP, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (idx < g_slist_length (list))); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (idx < g_slist_length (list))); ASSERT_UNCHANGED (nm_setting_vlan_remove_priority (s_vlan, NM_VLAN_INGRESS_MAP, 1)); g_test_assert_expected_messages (); ASSERT_CHANGED (nm_setting_vlan_add_priority_str (s_vlan, NM_VLAN_INGRESS_MAP, "1:3")); @@ -2073,7 +2072,7 @@ test_setting_vlan_changed_signal (void) ASSERT_CHANGED (nm_setting_vlan_add_priority (s_vlan, NM_VLAN_EGRESS_MAP, 1, 3)); ASSERT_CHANGED (nm_setting_vlan_remove_priority (s_vlan, NM_VLAN_EGRESS_MAP, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (idx < g_slist_length (list))); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (idx < g_slist_length (list))); ASSERT_UNCHANGED (nm_setting_vlan_remove_priority (s_vlan, NM_VLAN_EGRESS_MAP, 1)); g_test_assert_expected_messages (); ASSERT_CHANGED (nm_setting_vlan_add_priority_str (s_vlan, NM_VLAN_EGRESS_MAP, "1:3")); @@ -2172,7 +2171,7 @@ test_setting_wireless_security_changed_signal (void) /* Protos */ ASSERT_CHANGED (nm_setting_wireless_security_add_proto (s_wsec, "wpa")); ASSERT_CHANGED (nm_setting_wireless_security_remove_proto (s_wsec, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_wireless_security_remove_proto (s_wsec, 1)); g_test_assert_expected_messages (); @@ -2182,7 +2181,7 @@ test_setting_wireless_security_changed_signal (void) /* Pairwise ciphers */ ASSERT_CHANGED (nm_setting_wireless_security_add_pairwise (s_wsec, "tkip")); ASSERT_CHANGED (nm_setting_wireless_security_remove_pairwise (s_wsec, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_wireless_security_remove_pairwise (s_wsec, 1)); g_test_assert_expected_messages (); @@ -2192,7 +2191,7 @@ test_setting_wireless_security_changed_signal (void) /* Group ciphers */ ASSERT_CHANGED (nm_setting_wireless_security_add_group (s_wsec, "ccmp")); ASSERT_CHANGED (nm_setting_wireless_security_remove_group (s_wsec, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_wireless_security_remove_group (s_wsec, 1)); g_test_assert_expected_messages (); @@ -2227,7 +2226,7 @@ test_setting_802_1x_changed_signal (void) /* EAP methods */ ASSERT_CHANGED (nm_setting_802_1x_add_eap_method (s_8021x, "tls")); ASSERT_CHANGED (nm_setting_802_1x_remove_eap_method (s_8021x, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_802_1x_remove_eap_method (s_8021x, 1)); g_test_assert_expected_messages (); @@ -2237,7 +2236,7 @@ test_setting_802_1x_changed_signal (void) /* alternate subject matches */ ASSERT_CHANGED (nm_setting_802_1x_add_altsubject_match (s_8021x, "EMAIL:server@example.com")); ASSERT_CHANGED (nm_setting_802_1x_remove_altsubject_match (s_8021x, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_802_1x_remove_altsubject_match (s_8021x, 1)); g_test_assert_expected_messages (); @@ -2247,7 +2246,7 @@ test_setting_802_1x_changed_signal (void) /* phase2 alternate subject matches */ ASSERT_CHANGED (nm_setting_802_1x_add_phase2_altsubject_match (s_8021x, "EMAIL:server@example.com")); ASSERT_CHANGED (nm_setting_802_1x_remove_phase2_altsubject_match (s_8021x, 0)); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (elt != NULL)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (elt != NULL)); ASSERT_UNCHANGED (nm_setting_802_1x_remove_phase2_altsubject_match (s_8021x, 1)); g_test_assert_expected_messages (); @@ -2470,12 +2469,12 @@ test_nm_utils_uuid_generate_from_string (void) _test_uuid ("098f6bcd-4621-d373-cade-4e832627b4f6", "test"); _test_uuid ("59c0547b-7fe2-1c15-2cce-e328e8bf6742", "/etc/NetworkManager/system-connections/em1"); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (s && *s)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (s && *s)); uuid_test = nm_utils_uuid_generate_from_string (""); g_assert (uuid_test == NULL); g_test_assert_expected_messages (); - NMTST_EXPECT_LIBNM_U_CRITICAL (NMTST_G_RETURN_MSG (s && *s)); + g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, NMTST_G_RETURN_MSG (s && *s)); uuid_test = nm_utils_uuid_generate_from_string (NULL); g_assert (uuid_test == NULL); g_test_assert_expected_messages (); diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c index eb7113c3..ee0c997f 100644 --- a/libnm-util/tests/test-setting-dcb.c +++ b/libnm-util/tests/test-setting-dcb.c @@ -96,23 +96,23 @@ test_dcb_flags_invalid (void) s_dcb = (NMSettingDcb *) nm_setting_dcb_new (); g_assert (s_dcb); - NMTST_EXPECT ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); + g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); TEST_FLAG (NM_SETTING_DCB_APP_FCOE_FLAGS, nm_setting_dcb_get_app_fcoe_flags, 0x332523); g_test_assert_expected_messages (); - NMTST_EXPECT ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); + g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); TEST_FLAG (NM_SETTING_DCB_APP_ISCSI_FLAGS, nm_setting_dcb_get_app_iscsi_flags, 0xFF); g_test_assert_expected_messages (); - NMTST_EXPECT ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); + g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); TEST_FLAG (NM_SETTING_DCB_APP_FIP_FLAGS, nm_setting_dcb_get_app_fip_flags, 0x1111); g_test_assert_expected_messages (); - NMTST_EXPECT ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); + g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); TEST_FLAG (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS, nm_setting_dcb_get_priority_flow_control_flags, G_MAXUINT32); g_test_assert_expected_messages (); - NMTST_EXPECT ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); + g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING, "*invalid or out of range*"); TEST_FLAG (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS, nm_setting_dcb_get_priority_group_flags, (NM_SETTING_DCB_FLAG_ENABLE | NM_SETTING_DCB_FLAG_ADVERTISE | NM_SETTING_DCB_FLAG_WILLING) + 1); g_test_assert_expected_messages (); |