diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c index 926cddb08..87937b6a2 100644 --- a/libnm-core/tests/test-crypto.c +++ b/libnm-core/tests/test-crypto.c @@ -439,12 +439,14 @@ int main (int argc, char **argv) { GError *error = NULL; + gboolean success; int ret; nmtst_init (&argc, &argv, TRUE); - if (!crypto_init (&error)) - FAIL ("crypto-init", "failed to initialize crypto: %s", error->message); + success = crypto_init (&error); + g_assert_no_error (error); + g_assert (success); g_test_add_data_func ("/libnm/crypto/cert/pem", "test_ca_cert.pem", diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c index 5a8c4eb0b..8a1c87486 100644 --- a/libnm-util/tests/test-crypto.c +++ b/libnm-util/tests/test-crypto.c @@ -414,11 +414,13 @@ int main (int argc, char **argv) { GError *error = NULL; + gboolean success; nmtst_init (&argc, &argv, TRUE); - if (!crypto_init (&error)) - FAIL ("crypto-init", "failed to initialize crypto: %s", error->message); + success = crypto_init (&error); + g_assert_no_error (error); + g_assert (success); g_test_add_data_func ("/libnm/crypto/cert/pem", "test_ca_cert.pem", diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c index f5423d10c..6e0285d1e 100644 --- a/libnm-util/tests/test-secrets.c +++ b/libnm-util/tests/test-secrets.c @@ -739,11 +739,13 @@ NMTST_DEFINE (); int main (int argc, char **argv) { GError *error = NULL; + gboolean success; nmtst_init (&argc, &argv, TRUE); - if (!nm_utils_init (&error)) - FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + success = nm_utils_init (&error); + g_assert_no_error (error); + g_assert (success); /* The tests */ g_test_add_func ("/libnm/need_tls_secrets_path", test_need_tls_secrets_path); diff --git a/shared/nm-test-utils.h b/shared/nm-test-utils.h index b6bc332eb..89d32ccf8 100644 --- a/shared/nm-test-utils.h +++ b/shared/nm-test-utils.h @@ -1038,17 +1038,11 @@ _nmtst_assert_ip6_address (const char *file, int line, const struct in6_addr *ad } #define nmtst_assert_ip6_address(addr, str_expected) _nmtst_assert_ip6_address (__FILE__, __LINE__, addr, str_expected) -/* Deprecated: don't use this overly verbose macro. */ -#define FAIL(test_name, fmt, ...) \ - G_STMT_START { \ - g_error ("%s:%d: FAIL[%s]: " fmt, __FILE__, __LINE__, test_name, ## __VA_ARGS__); \ - } G_STMT_END - /* Deprecated: don't use this overly verbose macro. */ #define ASSERT(x, test_name, fmt, ...) \ G_STMT_START { \ if (!(x)) { \ - FAIL (test_name, fmt, ## __VA_ARGS__); \ + g_error ("%s:%d: FAIL[%s]: " fmt, __FILE__, __LINE__, test_name, ## __VA_ARGS__); \ } \ } G_STMT_END