tests: get rid of FAIL macro
This commit is contained in:
@@ -439,12 +439,14 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
gboolean success;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
nmtst_init (&argc, &argv, TRUE);
|
nmtst_init (&argc, &argv, TRUE);
|
||||||
|
|
||||||
if (!crypto_init (&error))
|
success = crypto_init (&error);
|
||||||
FAIL ("crypto-init", "failed to initialize crypto: %s", error->message);
|
g_assert_no_error (error);
|
||||||
|
g_assert (success);
|
||||||
|
|
||||||
g_test_add_data_func ("/libnm/crypto/cert/pem",
|
g_test_add_data_func ("/libnm/crypto/cert/pem",
|
||||||
"test_ca_cert.pem",
|
"test_ca_cert.pem",
|
||||||
|
@@ -414,11 +414,13 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
nmtst_init (&argc, &argv, TRUE);
|
nmtst_init (&argc, &argv, TRUE);
|
||||||
|
|
||||||
if (!crypto_init (&error))
|
success = crypto_init (&error);
|
||||||
FAIL ("crypto-init", "failed to initialize crypto: %s", error->message);
|
g_assert_no_error (error);
|
||||||
|
g_assert (success);
|
||||||
|
|
||||||
g_test_add_data_func ("/libnm/crypto/cert/pem",
|
g_test_add_data_func ("/libnm/crypto/cert/pem",
|
||||||
"test_ca_cert.pem",
|
"test_ca_cert.pem",
|
||||||
|
@@ -739,11 +739,13 @@ NMTST_DEFINE ();
|
|||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
nmtst_init (&argc, &argv, TRUE);
|
nmtst_init (&argc, &argv, TRUE);
|
||||||
|
|
||||||
if (!nm_utils_init (&error))
|
success = nm_utils_init (&error);
|
||||||
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
|
g_assert_no_error (error);
|
||||||
|
g_assert (success);
|
||||||
|
|
||||||
/* The tests */
|
/* The tests */
|
||||||
g_test_add_func ("/libnm/need_tls_secrets_path", test_need_tls_secrets_path);
|
g_test_add_func ("/libnm/need_tls_secrets_path", test_need_tls_secrets_path);
|
||||||
|
@@ -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)
|
#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. */
|
/* Deprecated: don't use this overly verbose macro. */
|
||||||
#define ASSERT(x, test_name, fmt, ...) \
|
#define ASSERT(x, test_name, fmt, ...) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
if (!(x)) { \
|
if (!(x)) { \
|
||||||
FAIL (test_name, fmt, ## __VA_ARGS__); \
|
g_error ("%s:%d: FAIL[%s]: " fmt, __FILE__, __LINE__, test_name, ## __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user