1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-06 20:03:46 -04:00

Added muc room active tests

This commit is contained in:
James Booth 2014-01-31 00:10:28 +00:00
parent 31321077de
commit 23842e5254
3 changed files with 27 additions and 0 deletions

View File

@ -56,3 +56,26 @@ void test_muc_invite_count_5(void **state)
assert_true(invite_count == 5);
}
void test_muc_room_is_not_active(void **state)
{
Jid *jidp = jid_create("room@server.org/bob");
gboolean room_is_active = muc_room_is_active(jidp);
assert_false(room_is_active);
jid_destroy(jidp);
}
void test_muc_room_is_active(void **state)
{
Jid *jidp = jid_create("room@server.org/bob");
muc_join_room(jidp->barejid, jidp->resourcepart);
gboolean room_is_active = muc_room_is_active(jidp);
assert_true(room_is_active);
jid_destroy(jidp);
}

View File

@ -5,3 +5,5 @@ void test_muc_add_invite(void **state);
void test_muc_remove_invite(void **state);
void test_muc_invite_count_0(void **state);
void test_muc_invite_count_5(void **state);
void test_muc_room_is_not_active(void **state);
void test_muc_room_is_active(void **state);

View File

@ -433,6 +433,8 @@ int main(int argc, char* argv[]) {
unit_test_setup_teardown(test_muc_remove_invite, muc_before_test, muc_after_test),
unit_test_setup_teardown(test_muc_invite_count_0, muc_before_test, muc_after_test),
unit_test_setup_teardown(test_muc_invite_count_5, muc_before_test, muc_after_test),
unit_test_setup_teardown(test_muc_room_is_not_active, muc_before_test, muc_after_test),
unit_test_setup_teardown(test_muc_room_is_active, muc_before_test, muc_after_test),
};
int bak, bak2, new;