diff --git a/tests/test_muc.c b/tests/test_muc.c index 37570666..ba4fef1d 100644 --- a/tests/test_muc.c +++ b/tests/test_muc.c @@ -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); +} diff --git a/tests/test_muc.h b/tests/test_muc.h index 75b63403..044d547d 100644 --- a/tests/test_muc.h +++ b/tests/test_muc.h @@ -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); diff --git a/tests/testsuite.c b/tests/testsuite.c index 4e016aef..e611fe42 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -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;