From c0796c470597870b3b821aad1ea352d666153e83 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 Oct 2009 16:04:12 +0100 Subject: rename check-irc-helper to test-irc-helper --- tests/Makefile.am | 6 +-- tests/check-irc-helper.c | 80 -------------------------------- tests/check-irc-helper.h | 24 ---------- tests/empathy-irc-network-manager-test.c | 2 +- tests/empathy-irc-network-test.c | 2 +- tests/empathy-irc-server-test.c | 2 +- tests/test-irc-helper.c | 80 ++++++++++++++++++++++++++++++++ tests/test-irc-helper.h | 24 ++++++++++ 8 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 tests/check-irc-helper.c delete mode 100644 tests/check-irc-helper.h create mode 100644 tests/test-irc-helper.c create mode 100644 tests/test-irc-helper.h (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 7821d8d2f..25e399406 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,15 +34,15 @@ empathy_utils_test_SOURCES = empathy-utils-test.c \ empathy_irc_server_test_SOURCES = empathy-irc-server-test.c \ test-helper.c test-helper.h \ - check-irc-helper.h check-irc-helper.c + test-irc-helper.h test-irc-helper.c empathy_irc_network_test_SOURCES = empathy-irc-network-test.c \ test-helper.c test-helper.h \ - check-irc-helper.h check-irc-helper.c + test-irc-helper.h test-irc-helper.c empathy_irc_network_manager_test_SOURCES = empathy-irc-network-manager-test.c \ test-helper.c test-helper.h \ - check-irc-helper.h check-irc-helper.c + test-irc-helper.h test-irc-helper.c empathy_chatroom_test_SOURCES = empathy-chatroom-test.c \ test-helper.c test-helper.h diff --git a/tests/check-irc-helper.c b/tests/check-irc-helper.c deleted file mode 100644 index 1a2832a7b..000000000 --- a/tests/check-irc-helper.c +++ /dev/null @@ -1,80 +0,0 @@ -#include "check-irc-helper.h" - -void -check_server (EmpathyIrcServer *server, - const gchar *_address, - guint _port, - gboolean _ssl) -{ - gchar *address; - guint port; - gboolean ssl; - - g_assert (server != NULL); - - g_object_get (server, - "address", &address, - "port", &port, - "ssl", &ssl, - NULL); - - g_assert (address != NULL && strcmp (address, _address) == 0); - g_assert (port == _port); - g_assert (ssl == _ssl); - - g_free (address); -} - -void -check_network (EmpathyIrcNetwork *network, - const gchar *_name, - const gchar *_charset, - struct server_t *_servers, - guint nb_servers) -{ - gchar *name, *charset; - GSList *servers, *l; - guint i; - - g_assert (network != NULL); - - g_object_get (network, - "name", &name, - "charset", &charset, - NULL); - - g_assert (name != NULL && strcmp (name, _name) == 0); - g_assert (charset != NULL && strcmp (charset, _charset) == 0); - - servers = empathy_irc_network_get_servers (network); - 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++) - { - EmpathyIrcServer *server; - gchar *address; - guint port; - gboolean ssl; - - server = l->data; - - g_object_get (server, - "address", &address, - "port", &port, - "ssl", &ssl, - NULL); - - 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); - } - - g_slist_foreach (servers, (GFunc) g_object_unref, NULL); - g_slist_free (servers); - g_free (name); - g_free (charset); -} diff --git a/tests/check-irc-helper.h b/tests/check-irc-helper.h deleted file mode 100644 index e375f6fb6..000000000 --- a/tests/check-irc-helper.h +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -#include -#include -#include - -#ifndef __CHECK_IRC_HELPER_H__ -#define __CHECK_IRC_HELPER_H__ - -struct server_t -{ - gchar *address; - guint port; - gboolean ssl; -}; - -void check_server (EmpathyIrcServer *server, const gchar *_address, - guint _port, gboolean _ssl); - -void check_network (EmpathyIrcNetwork *network, const gchar *_name, - const gchar *_charset, struct server_t *_servers, guint nb_servers); - -#endif /* __CHECK_IRC_HELPER_H__ */ diff --git a/tests/empathy-irc-network-manager-test.c b/tests/empathy-irc-network-manager-test.c index 711cdb22c..df1147070 100644 --- a/tests/empathy-irc-network-manager-test.c +++ b/tests/empathy-irc-network-manager-test.c @@ -3,7 +3,7 @@ #include #include -#include "check-irc-helper.h" +#include "test-irc-helper.h" #include "test-helper.h" #include diff --git a/tests/empathy-irc-network-test.c b/tests/empathy-irc-network-test.c index 00fbe91b1..313ab0651 100644 --- a/tests/empathy-irc-network-test.c +++ b/tests/empathy-irc-network-test.c @@ -2,7 +2,7 @@ #include #include -#include "check-irc-helper.h" +#include "test-irc-helper.h" #include "test-helper.h" #include diff --git a/tests/empathy-irc-server-test.c b/tests/empathy-irc-server-test.c index b9574c40c..573967e43 100644 --- a/tests/empathy-irc-server-test.c +++ b/tests/empathy-irc-server-test.c @@ -2,7 +2,7 @@ #include #include -#include "check-irc-helper.h" +#include "test-irc-helper.h" #include "test-helper.h" #include diff --git a/tests/test-irc-helper.c b/tests/test-irc-helper.c new file mode 100644 index 000000000..ade247f39 --- /dev/null +++ b/tests/test-irc-helper.c @@ -0,0 +1,80 @@ +#include "test-irc-helper.h" + +void +check_server (EmpathyIrcServer *server, + const gchar *_address, + guint _port, + gboolean _ssl) +{ + gchar *address; + guint port; + gboolean ssl; + + g_assert (server != NULL); + + g_object_get (server, + "address", &address, + "port", &port, + "ssl", &ssl, + NULL); + + g_assert (address != NULL && strcmp (address, _address) == 0); + g_assert (port == _port); + g_assert (ssl == _ssl); + + g_free (address); +} + +void +check_network (EmpathyIrcNetwork *network, + const gchar *_name, + const gchar *_charset, + struct server_t *_servers, + guint nb_servers) +{ + gchar *name, *charset; + GSList *servers, *l; + guint i; + + g_assert (network != NULL); + + g_object_get (network, + "name", &name, + "charset", &charset, + NULL); + + g_assert (name != NULL && strcmp (name, _name) == 0); + g_assert (charset != NULL && strcmp (charset, _charset) == 0); + + servers = empathy_irc_network_get_servers (network); + 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++) + { + EmpathyIrcServer *server; + gchar *address; + guint port; + gboolean ssl; + + server = l->data; + + g_object_get (server, + "address", &address, + "port", &port, + "ssl", &ssl, + NULL); + + 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); + } + + g_slist_foreach (servers, (GFunc) g_object_unref, NULL); + g_slist_free (servers); + g_free (name); + g_free (charset); +} diff --git a/tests/test-irc-helper.h b/tests/test-irc-helper.h new file mode 100644 index 000000000..e375f6fb6 --- /dev/null +++ b/tests/test-irc-helper.h @@ -0,0 +1,24 @@ +#include +#include + +#include +#include +#include + +#ifndef __CHECK_IRC_HELPER_H__ +#define __CHECK_IRC_HELPER_H__ + +struct server_t +{ + gchar *address; + guint port; + gboolean ssl; +}; + +void check_server (EmpathyIrcServer *server, const gchar *_address, + guint _port, gboolean _ssl); + +void check_network (EmpathyIrcNetwork *network, const gchar *_name, + const gchar *_charset, struct server_t *_servers, guint nb_servers); + +#endif /* __CHECK_IRC_HELPER_H__ */ -- cgit v1.2.3