aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/check-empathy-irc-chatroom-manager.c39
-rw-r--r--tests/check-libempathy.h1
-rw-r--r--tests/check-main.c1
-rw-r--r--tests/xml/Makefile.am3
-rw-r--r--tests/xml/chatrooms.xml2
6 files changed, 47 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6709a6a40..e92101959 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,7 +38,8 @@ check_main_SOURCES = \
check-empathy-irc-server.c \
check-empathy-irc-network.c \
check-empathy-irc-network-manager.c \
- check-empathy-chatroom.c
+ check-empathy-chatroom.c \
+ check-empathy-irc-chatroom-manager.c
check_main_LDADD = \
@CHECK_LIBS@ \
diff --git a/tests/check-empathy-irc-chatroom-manager.c b/tests/check-empathy-irc-chatroom-manager.c
new file mode 100644
index 000000000..0865a5ae0
--- /dev/null
+++ b/tests/check-empathy-irc-chatroom-manager.c
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <glib/gstdio.h>
+
+#include <check.h>
+#include "check-helpers.h"
+#include "check-libempathy.h"
+#include "check-irc-helper.h"
+
+#include <libempathy/empathy-chatroom-manager.h>
+
+static gchar *
+get_xml_file (const gchar *filename)
+{
+ return g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "tests", "xml",
+ filename, NULL);
+}
+
+START_TEST (test_empathy_chatroom_manager_new)
+{
+ EmpathyChatroomManager *mgr;
+ gchar *file;
+
+ file = get_xml_file ("chatrooms.xml");
+ mgr = empathy_chatroom_manager_new (file);
+
+ g_free (file);
+ g_object_unref (mgr);
+}
+END_TEST
+
+TCase *
+make_empathy_chatroom_manager_tcase (void)
+{
+ TCase *tc = tcase_create ("empathy-irc-chatroom-manager");
+ tcase_add_test (tc, test_empathy_chatroom_manager_new);
+ return tc;
+}
diff --git a/tests/check-libempathy.h b/tests/check-libempathy.h
index 48c58b81b..5dcb2b17a 100644
--- a/tests/check-libempathy.h
+++ b/tests/check-libempathy.h
@@ -6,5 +6,6 @@ TCase * make_empathy_irc_server_tcase (void);
TCase * make_empathy_irc_network_tcase (void);
TCase * make_empathy_irc_network_manager_tcase (void);
TCase * make_empathy_chatroom_tcase (void);
+TCase * make_empathy_chatroom_manager_tcase (void);
#endif /* #ifndef __CHECK_LIBEMPATHY__ */
diff --git a/tests/check-main.c b/tests/check-main.c
index 9c497a765..886e1e570 100644
--- a/tests/check-main.c
+++ b/tests/check-main.c
@@ -20,6 +20,7 @@ make_libempathy_suite (void)
suite_add_tcase (s, make_empathy_irc_network_tcase ());
suite_add_tcase (s, make_empathy_irc_network_manager_tcase ());
suite_add_tcase (s, make_empathy_chatroom_tcase ());
+ suite_add_tcase (s, make_empathy_chatroom_manager_tcase ());
return s;
}
diff --git a/tests/xml/Makefile.am b/tests/xml/Makefile.am
index eafe8de6c..d35bdc65f 100644
--- a/tests/xml/Makefile.am
+++ b/tests/xml/Makefile.am
@@ -1,3 +1,4 @@
EXTRA_DIST = \
default-irc-networks-sample.xml \
- user-irc-networks-sample.xml
+ user-irc-networks-sample.xml \
+ chatrooms.xml
diff --git a/tests/xml/chatrooms.xml b/tests/xml/chatrooms.xml
new file mode 100644
index 000000000..57073b7be
--- /dev/null
+++ b/tests/xml/chatrooms.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chatrooms/>