aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check-empathy-irc-server.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-02-18 07:38:19 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-02-18 07:38:19 +0800
commit8107cb72c02be53157fc87955b4bc4f454662182 (patch)
treec37e04a560b3c654a5b509e2dd02c5a79178bed1 /tests/check-empathy-irc-server.c
parent20c9a85036f7c951eb24df9587db695895869342 (diff)
downloadgsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar.gz
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar.bz2
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar.lz
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar.xz
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.tar.zst
gsoc2013-empathy-8107cb72c02be53157fc87955b4bc4f454662182.zip
Merge commit 'cassidy/irc'
svn path=/trunk/; revision=649
Diffstat (limited to 'tests/check-empathy-irc-server.c')
-rw-r--r--tests/check-empathy-irc-server.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/tests/check-empathy-irc-server.c b/tests/check-empathy-irc-server.c
new file mode 100644
index 000000000..52607f221
--- /dev/null
+++ b/tests/check-empathy-irc-server.c
@@ -0,0 +1,93 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <check.h>
+#include "check-helpers.h"
+#include "check-libempathy.h"
+#include "check-irc-helper.h"
+
+#include <libempathy/empathy-irc-server.h>
+
+START_TEST (test_empathy_irc_server_new)
+{
+ EmpathyIrcServer *server;
+
+ server = empathy_irc_server_new ("test.localhost", 6667, TRUE);
+ check_server (server, "test.localhost", 6667, TRUE);
+
+ g_object_unref (server);
+}
+END_TEST
+
+START_TEST (test_property_change)
+{
+ EmpathyIrcServer *server;
+
+ server = empathy_irc_server_new ("test.localhost", 6667, TRUE);
+ fail_if (server == NULL);
+
+ g_object_set (server,
+ "address", "test2.localhost",
+ "port", 6668,
+ "ssl", FALSE,
+ NULL);
+
+ check_server (server, "test2.localhost", 6668, FALSE);
+
+ g_object_unref (server);
+}
+END_TEST
+
+static gboolean modified = FALSE;
+
+static void
+modified_cb (EmpathyIrcServer *server,
+ gpointer unused)
+{
+ modified = TRUE;
+}
+
+START_TEST (test_modified_signal)
+{
+ EmpathyIrcServer *server;
+
+ server = empathy_irc_server_new ("test.localhost", 6667, TRUE);
+ fail_if (server == NULL);
+
+ g_signal_connect (server, "modified", G_CALLBACK (modified_cb), NULL);
+
+ /* address */
+ g_object_set (server, "address", "test2.localhost", NULL);
+ fail_if (!modified);
+ modified = FALSE;
+ g_object_set (server, "address", "test2.localhost", NULL);
+ fail_if (modified);
+
+ /* port */
+ g_object_set (server, "port", 6668, NULL);
+ fail_if (!modified);
+ modified = FALSE;
+ g_object_set (server, "port", 6668, NULL);
+ fail_if (modified);
+
+ /* ssl */
+ g_object_set (server, "ssl", FALSE, NULL);
+ fail_if (!modified);
+ modified = FALSE;
+ g_object_set (server, "ssl", FALSE, NULL);
+ fail_if (modified);
+
+ g_object_unref (server);
+}
+END_TEST
+
+TCase *
+make_empathy_irc_server_tcase (void)
+{
+ TCase *tc = tcase_create ("empathy-irc-server");
+ tcase_add_test (tc, test_empathy_irc_server_new);
+ tcase_add_test (tc, test_property_change);
+ tcase_add_test (tc, test_modified_signal);
+ return tc;
+}