mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 09:36:21 +00:00
Tidied muc module
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user