From 85268449651286df02e6da607abd98828fd68a6a Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 Oct 2009 16:10:41 +0000 Subject: port check-empathy-irc-server.c to GTest --- tests/check-irc-helper.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/check-irc-helper.c') diff --git a/tests/check-irc-helper.c b/tests/check-irc-helper.c index 477b134c..1a2832a7 100644 --- a/tests/check-irc-helper.c +++ b/tests/check-irc-helper.c @@ -10,7 +10,7 @@ check_server (EmpathyIrcServer *server, guint port; gboolean ssl; - fail_if (server == NULL); + g_assert (server != NULL); g_object_get (server, "address", &address, @@ -18,9 +18,9 @@ check_server (EmpathyIrcServer *server, "ssl", &ssl, NULL); - fail_if (address == NULL || strcmp (address, _address) != 0); - fail_if (port != _port); - fail_if (ssl != _ssl); + g_assert (address != NULL && strcmp (address, _address) == 0); + g_assert (port == _port); + g_assert (ssl == _ssl); g_free (address); } @@ -36,18 +36,18 @@ check_network (EmpathyIrcNetwork *network, GSList *servers, *l; guint i; - fail_if (network == NULL); + g_assert (network != NULL); g_object_get (network, "name", &name, "charset", &charset, NULL); - fail_if (name == NULL || strcmp (name, _name) != 0); - fail_if (charset == NULL || strcmp (charset, _charset) != 0); + g_assert (name != NULL && strcmp (name, _name) == 0); + g_assert (charset != NULL && strcmp (charset, _charset) == 0); servers = empathy_irc_network_get_servers (network); - fail_if (g_slist_length (servers) != nb_servers); + g_assert (g_slist_length (servers) == nb_servers); /* Is that the right servers ? */ for (l = servers, i = 0; l != NULL; l = g_slist_next (l), i++) @@ -65,10 +65,10 @@ check_network (EmpathyIrcNetwork *network, "ssl", &ssl, NULL); - fail_if (address == NULL || strcmp (address, _servers[i].address) - != 0); - fail_if (port != _servers[i].port); - fail_if (ssl != _servers[i].ssl); + g_assert (address != NULL && strcmp (address, _servers[i].address) + == 0); + g_assert (port == _servers[i].port); + g_assert (ssl == _servers[i].ssl); g_free (address); } -- cgit v1.2.3