empathy r1543 - in trunk/tests: . xml



Author: xclaesse
Date: Mon Oct 13 07:53:47 2008
New Revision: 1543
URL: http://svn.gnome.org/viewvc/empathy?rev=1543&view=rev

Log:
add a test file for EmpathyChatroomManager

Added:
   trunk/tests/check-empathy-irc-chatroom-manager.c
   trunk/tests/xml/chatrooms.xml
Modified:
   trunk/tests/Makefile.am
   trunk/tests/check-libempathy.h
   trunk/tests/check-main.c
   trunk/tests/xml/Makefile.am

Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am	(original)
+++ trunk/tests/Makefile.am	Mon Oct 13 07:53:47 2008
@@ -38,7 +38,8 @@
     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@ \

Added: trunk/tests/check-empathy-irc-chatroom-manager.c
==============================================================================
--- (empty file)
+++ trunk/tests/check-empathy-irc-chatroom-manager.c	Mon Oct 13 07:53:47 2008
@@ -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;
+}

Modified: trunk/tests/check-libempathy.h
==============================================================================
--- trunk/tests/check-libempathy.h	(original)
+++ trunk/tests/check-libempathy.h	Mon Oct 13 07:53:47 2008
@@ -6,5 +6,6 @@
 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__ */

Modified: trunk/tests/check-main.c
==============================================================================
--- trunk/tests/check-main.c	(original)
+++ trunk/tests/check-main.c	Mon Oct 13 07:53:47 2008
@@ -20,6 +20,7 @@
     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;
 }

Modified: trunk/tests/xml/Makefile.am
==============================================================================
--- trunk/tests/xml/Makefile.am	(original)
+++ trunk/tests/xml/Makefile.am	Mon Oct 13 07:53:47 2008
@@ -1,3 +1,4 @@
 EXTRA_DIST = 				\
 	default-irc-networks-sample.xml	\
-	user-irc-networks-sample.xml
+	user-irc-networks-sample.xml \
+	chatrooms.xml

Added: trunk/tests/xml/chatrooms.xml
==============================================================================
--- (empty file)
+++ trunk/tests/xml/chatrooms.xml	Mon Oct 13 07:53:47 2008
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chatrooms/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]