diff options
author | irungentoo <irungentoo@gmail.com> | 2014-12-20 23:12:43 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-12-20 23:12:43 -0500 |
commit | d1eb793a9c1f21e23644d3b2f35d16e1891162ca (patch) | |
tree | 8ca0f2d67ced9fe547ce04713925d782f0b5ede1 /auto_tests/tox_test.c | |
parent | 3ce743fa9da3d504802d96a49e1c93936e12d51d (diff) |
auto test group titles.
Diffstat (limited to 'auto_tests/tox_test.c')
-rw-r--r-- | auto_tests/tox_test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 7f6443b7..3240f29a 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c | |||
@@ -554,6 +554,7 @@ START_TEST(test_many_group) | |||
554 | 554 | ||
555 | ck_assert_msg(tox_add_groupchat(toxes[0]) != -1, "Failed to create group"); | 555 | ck_assert_msg(tox_add_groupchat(toxes[0]) != -1, "Failed to create group"); |
556 | ck_assert_msg(tox_invite_friend(toxes[0], 0, 0) == 0, "Failed to invite friend"); | 556 | ck_assert_msg(tox_invite_friend(toxes[0], 0, 0) == 0, "Failed to invite friend"); |
557 | ck_assert_msg(tox_group_set_title(toxes[0], 0, "Gentoo", sizeof("Gentoo") - 1) == 0, "Failed to set group title"); | ||
557 | invite_counter = ~0; | 558 | invite_counter = ~0; |
558 | 559 | ||
559 | unsigned int done = ~0; | 560 | unsigned int done = ~0; |
@@ -580,6 +581,11 @@ START_TEST(test_many_group) | |||
580 | int num_peers = tox_group_number_peers(toxes[i], 0); | 581 | int num_peers = tox_group_number_peers(toxes[i], 0); |
581 | ck_assert_msg(num_peers == NUM_GROUP_TOX, "Bad number of group peers. expected: %u got: %i, tox %u", NUM_GROUP_TOX, | 582 | ck_assert_msg(num_peers == NUM_GROUP_TOX, "Bad number of group peers. expected: %u got: %i, tox %u", NUM_GROUP_TOX, |
582 | num_peers, i); | 583 | num_peers, i); |
584 | |||
585 | uint8_t title[2048]; | ||
586 | int ret = tox_group_get_title(toxes[i], 0, title, sizeof(title)); | ||
587 | ck_assert_msg(ret == sizeof("Gentoo") - 1, "Wrong title length"); | ||
588 | ck_assert_msg(memcmp("Gentoo", title, ret) == 0, "Wrong title"); | ||
583 | } | 589 | } |
584 | 590 | ||
585 | printf("group connected\n"); | 591 | printf("group connected\n"); |