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

Added muc invite count tests

This commit is contained in:
James Booth 2014-01-30 23:49:58 +00:00
parent 16aecaf017
commit 31321077de
3 changed files with 24 additions and 0 deletions

View File

@ -36,3 +36,23 @@ void test_muc_remove_invite(void **state)
assert_false(invite_exists);
}
void test_muc_invite_count_0(void **state)
{
int invite_count = muc_invite_count();
assert_true(invite_count == 0);
}
void test_muc_invite_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");
int invite_count = muc_invite_count();
assert_true(invite_count == 5);
}

View File

@ -3,3 +3,5 @@ void muc_after_test(void **state);
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);

View File

@ -431,6 +431,8 @@ int main(int argc, char* argv[]) {
const UnitTest muc_tests[] = {
unit_test_setup_teardown(test_muc_add_invite, 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),
};
int bak, bak2, new;