diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-10-13 15:54:37 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-10-13 15:54:37 +0800 |
commit | 7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07 (patch) | |
tree | 9f41b1e590f76285eee0cdf2444d198e60627810 /tests | |
parent | 98936f8fac2745671d5623d443b95bc338d68908 (diff) | |
download | gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar.gz gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar.bz2 gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar.lz gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar.xz gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.tar.zst gsoc2013-empathy-7d83d3fdde1ea98df35fe5a093cf0f2a591f1c07.zip |
factor out check_chatroom
svn path=/trunk/; revision=1558
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check-empathy-chatroom-manager.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/check-empathy-chatroom-manager.c b/tests/check-empathy-chatroom-manager.c index 5ea7fe8a7..276a388fe 100644 --- a/tests/check-empathy-chatroom-manager.c +++ b/tests/check-empathy-chatroom-manager.c @@ -17,6 +17,22 @@ #define CHATROOM_SAMPLE "chatrooms-sample.xml" #define CHATROOM_FILE "chatrooms.xml" +static void +check_chatroom (EmpathyChatroom *chatroom, + const gchar *name, + const gchar *room, + gboolean auto_connect, + gboolean favorite) +{ + gboolean _favorite; + + fail_if (tp_strdiff (empathy_chatroom_get_name (chatroom), name)); + fail_if (tp_strdiff (empathy_chatroom_get_room (chatroom), room)); + fail_if (empathy_chatroom_get_auto_connect (chatroom) != auto_connect); + g_object_get (chatroom, "favorite", &_favorite, NULL); + fail_if (favorite != _favorite); +} + START_TEST (test_empathy_chatroom_manager_new) { EmpathyChatroomManager *mgr; @@ -48,23 +64,16 @@ START_TEST (test_empathy_chatroom_manager_new) for (l = chatrooms; l != NULL; l = g_list_next (l)) { EmpathyChatroom *chatroom = l->data; - gboolean favorite; if (!tp_strdiff (empathy_chatroom_get_room (chatroom), "room1")) { room1_found = TRUE; - fail_if (tp_strdiff (empathy_chatroom_get_name (chatroom), "name1")); - fail_if (!empathy_chatroom_get_auto_connect (chatroom)); - g_object_get (chatroom, "favorite", &favorite, NULL); - fail_if (!favorite); + check_chatroom (chatroom, "name1", "room1", TRUE, TRUE); } else if (!tp_strdiff (empathy_chatroom_get_room (chatroom), "room2")) { room2_found = TRUE; - fail_if (tp_strdiff (empathy_chatroom_get_name (chatroom), "name2")); - fail_if (empathy_chatroom_get_auto_connect (chatroom)); - g_object_get (chatroom, "favorite", &favorite, NULL); - fail_if (!favorite); + check_chatroom (chatroom, "name2", "room2", FALSE, TRUE); } else { |