empathy r1560 - trunk/tests
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1560 - trunk/tests
- Date: Mon, 13 Oct 2008 07:54:48 +0000 (UTC)
Author: xclaesse
Date: Mon Oct 13 07:54:48 2008
New Revision: 1560
URL: http://svn.gnome.org/viewvc/empathy?rev=1560&view=rev
Log:
check_chatrooms_list: don't depend on the order of the chatrooms in the list
Modified:
trunk/tests/check-empathy-chatroom-manager.c
Modified: trunk/tests/check-empathy-chatroom-manager.c
==============================================================================
--- trunk/tests/check-empathy-chatroom-manager.c (original)
+++ trunk/tests/check-empathy-chatroom-manager.c Mon Oct 13 07:54:48 2008
@@ -49,19 +49,36 @@
{
GList *chatrooms, *l;
guint i;
+ GHashTable *found;
fail_if (empathy_chatroom_manager_get_count (mgr, account) != nb_chatrooms);
+ found = g_hash_table_new (g_str_hash, g_str_equal);
+ for (i = 0; i < nb_chatrooms; i++)
+ {
+ g_hash_table_insert (found, _chatrooms[i].room, &_chatrooms[i]);
+ }
+
chatrooms = empathy_chatroom_manager_get_chatrooms (mgr, account);
fail_if (g_list_length (chatrooms) != nb_chatrooms);
- for (l = chatrooms, i = 0; l != NULL; l = g_list_next (l), i++)
+ for (l = chatrooms; l != NULL; l = g_list_next (l))
{
EmpathyChatroom *chatroom = l->data;
+ struct chatroom_t *tmp;
+
+ tmp = g_hash_table_lookup (found, empathy_chatroom_get_room (chatroom));
+ fail_if (tmp == NULL);
- check_chatroom (chatroom, _chatrooms[i].name, _chatrooms[i].room,
- _chatrooms[i].auto_connect, _chatrooms[i].favorite);
+ check_chatroom (chatroom, tmp->name, tmp->room, tmp->auto_connect,
+ tmp->favorite);
+
+ g_hash_table_remove (found, empathy_chatroom_get_room (chatroom));
}
+
+ fail_if (g_hash_table_size (found) != 0);
+
+ g_hash_table_destroy (found);
}
START_TEST (test_empathy_chatroom_manager_new)
@@ -71,8 +88,8 @@
gchar *file;
McAccount *account;
struct chatroom_t chatrooms[] = {
- { "name2", "room2", FALSE, TRUE },
- { "name1", "room1", TRUE, TRUE }};
+ { "name1", "room1", TRUE, TRUE },
+ { "name2", "room2", FALSE, TRUE }};
account = create_test_account ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]