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

Tests valid and invalid resource presence strings

This commit is contained in:
James Booth 2013-12-17 22:58:27 +00:00
parent 99f4eeb60d
commit d5a2e645bf
3 changed files with 56 additions and 0 deletions

View File

@ -424,3 +424,43 @@ void next_available_24_first_big_gap(void **state)
assert_int_equal(24, result);
}
void test_online_is_valid_resource_presence_string(void **state)
{
assert_true(valid_resource_presence_string("online"));
}
void test_chat_is_valid_resource_presence_string(void **state)
{
assert_true(valid_resource_presence_string("chat"));
}
void test_away_is_valid_resource_presence_string(void **state)
{
assert_true(valid_resource_presence_string("away"));
}
void test_xa_is_valid_resource_presence_string(void **state)
{
assert_true(valid_resource_presence_string("xa"));
}
void test_dnd_is_valid_resource_presence_string(void **state)
{
assert_true(valid_resource_presence_string("dnd"));
}
void test_available_is_not_valid_resource_presence_string(void **state)
{
assert_false(valid_resource_presence_string("available"));
}
void test_unavailable_is_not_valid_resource_presence_string(void **state)
{
assert_false(valid_resource_presence_string("unavailable"));
}
void test_blah_is_not_valid_resource_presence_string(void **state)
{
assert_false(valid_resource_presence_string("blah"));
}

View File

@ -30,3 +30,11 @@ void next_available_9_in_first_gap(void **state);
void next_available_0_in_first_gap(void **state);
void next_available_11_in_first_gap(void **state);
void next_available_24_first_big_gap(void **state);
void test_online_is_valid_resource_presence_string(void **state);
void test_chat_is_valid_resource_presence_string(void **state);
void test_away_is_valid_resource_presence_string(void **state);
void test_xa_is_valid_resource_presence_string(void **state);
void test_dnd_is_valid_resource_presence_string(void **state);
void test_available_is_not_valid_resource_presence_string(void **state);
void test_unavailable_is_not_valid_resource_presence_string(void **state);
void test_blah_is_not_valid_resource_presence_string(void **state);

View File

@ -47,6 +47,14 @@ int main(int argc, char* argv[]) {
unit_test(next_available_0_in_first_gap),
unit_test(next_available_11_in_first_gap),
unit_test(next_available_24_first_big_gap),
unit_test(test_online_is_valid_resource_presence_string),
unit_test(test_chat_is_valid_resource_presence_string),
unit_test(test_away_is_valid_resource_presence_string),
unit_test(test_xa_is_valid_resource_presence_string),
unit_test(test_dnd_is_valid_resource_presence_string),
unit_test(test_available_is_not_valid_resource_presence_string),
unit_test(test_unavailable_is_not_valid_resource_presence_string),
unit_test(test_blah_is_not_valid_resource_presence_string),
unit_test(clear_empty),
unit_test(reset_after_create),