aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-12 20:28:39 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-12 20:28:39 +0000
commit00a0bc5cbed11bab2446267a9f3ad76666ceee75 (patch)
treee3c1a3d5ac759b99ff332e28921940e608ff9f51 /tests
parentdde9d5710cd6392592c1417032933f0ba4299d9c (diff)
Test activity_timeout and some other test tweaks.
Diffstat (limited to 'tests')
-rw-r--r--tests/check_jabber_util.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/check_jabber_util.c b/tests/check_jabber_util.c
index d105f52a..47e1e1a0 100644
--- a/tests/check_jabber_util.c
+++ b/tests/check_jabber_util.c
@@ -59,14 +59,26 @@ static void check_buddy_add(int l)
fail_if( jabber_buddy_by_jid( ic, "wilmer@GAAST.NET/telepathy", GET_BUDDY_CREAT ) == budw2 );
fail_unless( jabber_buddy_remove( ic, "wilmer@gaast.net/Telepathy" ) );
fail_unless( jabber_buddy_remove( ic, "wilmer@gaast.net/telepathy" ) );
- fail_unless( jabber_buddy_by_jid( ic, "wilmer@gaast.net", 0 ) == budw1 );
+
+ /* Test activity_timeout and GET_BUDDY_BARE_OK. */
+ fail_unless( jabber_buddy_by_jid( ic, "wilmer@gaast.net", GET_BUDDY_BARE_OK ) == budw1 );
+ budw1->last_msg -= 50;
+ fail_unless( ( bud = jabber_buddy_by_jid( ic, "wilmer@gaast.net", GET_BUDDY_BARE_OK ) ) != NULL );
+ fail_unless( strcmp( bud->full_jid, "wilmer@gaast.net" ) == 0 );
fail_if( jabber_buddy_remove( ic, "wilmer@gaast.net" ) );
fail_unless( jabber_buddy_by_jid( ic, "wilmer@gaast.net", 0 ) == budw1 );
+ fail_if( jabber_buddy_remove( ic, "wilmer@gaast.net" ) );
+ fail_unless( jabber_buddy_remove( ic, "wilmer@gaast.net/bitlbee" ) );
+ fail_unless( jabber_buddy_remove( ic, "wilmer@gaast.net/BitlBee" ) );
+ fail_if( jabber_buddy_by_jid( ic, "wilmer@gaast.net", GET_BUDDY_BARE_OK ) );
+
/* Check if remove_bare() indeed gets rid of all. */
+ /* disable this one for now.
fail_unless( jabber_buddy_remove_bare( ic, "wilmer@gaast.net" ) );
fail_if( jabber_buddy_by_jid( ic, "wilmer@gaast.net", 0 ) );
+ */
fail_if( jabber_buddy_remove( ic, "nekkid@lamejab.net/Illegal" ) );
fail_unless( jabber_buddy_remove( ic, "nekkid@lamejab.net" ) );
@@ -84,6 +96,7 @@ Suite *jabber_util_suite (void)
ic->proto_data = jd = g_new0( struct jabber_data, 1 );
jd->buddies = g_hash_table_new( g_str_hash, g_str_equal );
set_add( &ic->acc->set, "resource_select", "priority", NULL, ic->acc );
+ set_add( &ic->acc->set, "activity_timeout", "120", NULL, ic->acc );
suite_add_tcase (s, tc_core);
tcase_add_test (tc_core, check_buddy_add);