summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/tox_test.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c
index e7cc237a..189240c3 100644
--- a/auto_tests/tox_test.c
+++ b/auto_tests/tox_test.c
@@ -478,6 +478,12 @@ START_TEST(test_few_clients)
478 478
479 printf("tox clients messaging succeeded\n"); 479 printf("tox clients messaging succeeded\n");
480 480
481 unsigned int save_size1 = tox_get_savedata_size(tox2);
482 ck_assert_msg(save_size1 != 0 && save_size1 < 4096, "save is invalid size %u", save_size1);
483 printf("%u\n", save_size1);
484 uint8_t save1[save_size1];
485 tox_get_savedata(tox2, save1);
486
481 tox_callback_friend_name(tox3, print_nickchange, &to_compare); 487 tox_callback_friend_name(tox3, print_nickchange, &to_compare);
482 TOX_ERR_SET_INFO err_n; 488 TOX_ERR_SET_INFO err_n;
483 bool succ = tox_self_set_name(tox2, (uint8_t *)"Gentoo", sizeof("Gentoo"), &err_n); 489 bool succ = tox_self_set_name(tox2, (uint8_t *)"Gentoo", sizeof("Gentoo"), &err_n);
@@ -798,10 +804,10 @@ START_TEST(test_many_clients)
798 unsigned int num_f = 0; 804 unsigned int num_f = 0;
799 805
800 for (i = 0; i < NUM_TOXES; ++i) { 806 for (i = 0; i < NUM_TOXES; ++i) {
801 num_f += tox_self_get_friend_list_size(); 807 num_f += tox_self_get_friend_list_size(toxes[i]);
802 } 808 }
803 809
804 ck_assert_msg(num_f == NUM_FRIENDS * 2, "bad num friends"); 810 ck_assert_msg(num_f == 0, "bad num friends: %u", num_f);
805 811
806 for (i = 0; i < NUM_FRIENDS; ++i) { 812 for (i = 0; i < NUM_FRIENDS; ++i) {
807loop_top: 813loop_top:
@@ -825,6 +831,12 @@ loop_top:
825 ck_assert_msg(num != UINT32_MAX && test == TOX_ERR_FRIEND_ADD_OK, "Failed to add friend error code: %i", test); 831 ck_assert_msg(num != UINT32_MAX && test == TOX_ERR_FRIEND_ADD_OK, "Failed to add friend error code: %i", test);
826 } 832 }
827 833
834 for (i = 0; i < NUM_TOXES; ++i) {
835 num_f += tox_self_get_friend_list_size(toxes[i]);
836 }
837
838 ck_assert_msg(num_f == NUM_FRIENDS * 2, "bad num friends: %u", num_f);
839
828 while (1) { 840 while (1) {
829 uint16_t counter = 0; 841 uint16_t counter = 0;
830 842