diff options
author | James Booth <boothj5@gmail.com> | 2014-09-28 22:09:20 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-09-28 22:09:20 +0100 |
commit | d25d6b450201ee58f41e55d57da093eafa25e20c (patch) | |
tree | 0ec326336d9d1e6972034a01a86d7100dd9ed848 /tests | |
parent | 41b49cb5d6507636070c4d65f0e3f006c1ac9952 (diff) | |
download | profani-tty-d25d6b450201ee58f41e55d57da093eafa25e20c.tar.gz |
Tidied muc module
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_muc.c | 38 | ||||
-rw-r--r-- | tests/test_muc.h | 8 | ||||
-rw-r--r-- | tests/testsuite.c | 8 |
3 files changed, 27 insertions, 27 deletions
diff --git a/tests/test_muc.c b/tests/test_muc.c index be7279a5..5566c17e 100644 --- a/tests/test_muc.c +++ b/tests/test_muc.c @@ -16,12 +16,12 @@ void muc_after_test(void **state) muc_close(); } -void test_muc_add_invite(void **state) +void test_muc_invites_add(void **state) { char *room = "room@conf.server"; - muc_add_invite(room); + muc_invites_add(room); - gboolean invite_exists = muc_invites_include(room); + gboolean invite_exists = muc_invites_contain(room); assert_true(invite_exists); } @@ -29,30 +29,30 @@ void test_muc_add_invite(void **state) void test_muc_remove_invite(void **state) { char *room = "room@conf.server"; - muc_add_invite(room); - muc_remove_invite(room); + muc_invites_add(room); + muc_invites_remove(room); - gboolean invite_exists = muc_invites_include(room); + gboolean invite_exists = muc_invites_contain(room); assert_false(invite_exists); } -void test_muc_invite_count_0(void **state) +void test_muc_invites_count_0(void **state) { - int invite_count = muc_invite_count(); + int invite_count = muc_invites_count(); assert_true(invite_count == 0); } -void test_muc_invite_count_5(void **state) +void test_muc_invites_count_5(void **state) { - muc_add_invite("room1@conf.server"); - muc_add_invite("room2@conf.server"); - muc_add_invite("room3@conf.server"); - muc_add_invite("room4@conf.server"); - muc_add_invite("room5@conf.server"); + muc_invites_add("room1@conf.server"); + muc_invites_add("room2@conf.server"); + muc_invites_add("room3@conf.server"); + muc_invites_add("room4@conf.server"); + muc_invites_add("room5@conf.server"); - int invite_count = muc_invite_count(); + int invite_count = muc_invites_count(); assert_true(invite_count == 5); } @@ -61,18 +61,18 @@ void test_muc_room_is_not_active(void **state) { char *room = "room@server.org"; - gboolean room_is_active = muc_room_is_active(room); + gboolean room_is_active = muc_active(room); assert_false(room_is_active); } -void test_muc_room_is_active(void **state) +void test_muc_active(void **state) { char *room = "room@server.org"; char *nick = "bob"; - muc_join_room(room, nick, NULL, FALSE); + muc_join(room, nick, NULL, FALSE); - gboolean room_is_active = muc_room_is_active(room); + gboolean room_is_active = muc_active(room); assert_true(room_is_active); } diff --git a/tests/test_muc.h b/tests/test_muc.h index 044d547d..8df54a5d 100644 --- a/tests/test_muc.h +++ b/tests/test_muc.h @@ -1,9 +1,9 @@ void muc_before_test(void **state); void muc_after_test(void **state); -void test_muc_add_invite(void **state); +void test_muc_invites_add(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_invites_count_0(void **state); +void test_muc_invites_count_5(void **state); void test_muc_room_is_not_active(void **state); -void test_muc_room_is_active(void **state); +void test_muc_active(void **state); diff --git a/tests/testsuite.c b/tests/testsuite.c index 3441ceb9..1dcabe73 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -419,12 +419,12 @@ int main(int argc, char* argv[]) { load_preferences, close_preferences), - unit_test_setup_teardown(test_muc_add_invite, muc_before_test, muc_after_test), + unit_test_setup_teardown(test_muc_invites_add, muc_before_test, muc_after_test), 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_invites_count_0, muc_before_test, muc_after_test), + unit_test_setup_teardown(test_muc_invites_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), + unit_test_setup_teardown(test_muc_active, muc_before_test, muc_after_test), unit_test(cmd_bookmark_shows_message_when_disconnected), unit_test(cmd_bookmark_shows_message_when_disconnecting), |