diff options
Diffstat (limited to 'auto_tests/tox_test.c')
-rw-r--r-- | auto_tests/tox_test.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 40022b0a..22528330 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c | |||
@@ -286,8 +286,8 @@ void tox_connection_status(Tox *tox, TOX_CONNECTION connection_status, void *use | |||
286 | 286 | ||
287 | START_TEST(test_one) | 287 | START_TEST(test_one) |
288 | { | 288 | { |
289 | Tox *tox1 = tox_new(0, 0, 0, 0); | 289 | Tox *tox1 = tox_new(0, 0); |
290 | Tox *tox2 = tox_new(0, 0, 0, 0); | 290 | Tox *tox2 = tox_new(0, 0); |
291 | 291 | ||
292 | { | 292 | { |
293 | TOX_ERR_GET_PORT error; | 293 | TOX_ERR_GET_PORT error; |
@@ -340,7 +340,12 @@ START_TEST(test_one) | |||
340 | tox_kill(tox2); | 340 | tox_kill(tox2); |
341 | TOX_ERR_NEW err_n; | 341 | TOX_ERR_NEW err_n; |
342 | 342 | ||
343 | tox2 = tox_new(0, data, save_size, &err_n); | 343 | struct Tox_Options options; |
344 | tox_options_default(&options); | ||
345 | options.savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE; | ||
346 | options.savedata_data = data; | ||
347 | options.savedata_length = save_size; | ||
348 | tox2 = tox_new(&options, &err_n); | ||
344 | ck_assert_msg(err_n == TOX_ERR_NEW_OK, "Load failed"); | 349 | ck_assert_msg(err_n == TOX_ERR_NEW_OK, "Load failed"); |
345 | 350 | ||
346 | ck_assert_msg(tox_self_get_name_size(tox2) == sizeof name, "Wrong name size."); | 351 | ck_assert_msg(tox_self_get_name_size(tox2) == sizeof name, "Wrong name size."); |
@@ -361,11 +366,11 @@ START_TEST(test_few_clients) | |||
361 | { | 366 | { |
362 | long long unsigned int con_time, cur_time = time(NULL); | 367 | long long unsigned int con_time, cur_time = time(NULL); |
363 | TOX_ERR_NEW t_n_error; | 368 | TOX_ERR_NEW t_n_error; |
364 | Tox *tox1 = tox_new(0, 0, 0, &t_n_error); | 369 | Tox *tox1 = tox_new(0, &t_n_error); |
365 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); | 370 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); |
366 | Tox *tox2 = tox_new(0, 0, 0, &t_n_error); | 371 | Tox *tox2 = tox_new(0, &t_n_error); |
367 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); | 372 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); |
368 | Tox *tox3 = tox_new(0, 0, 0, &t_n_error); | 373 | Tox *tox3 = tox_new(0, &t_n_error); |
369 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); | 374 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); |
370 | 375 | ||
371 | ck_assert_msg(tox1 || tox2 || tox3, "Failed to create 3 tox instances"); | 376 | ck_assert_msg(tox1 || tox2 || tox3, "Failed to create 3 tox instances"); |
@@ -745,7 +750,7 @@ START_TEST(test_many_clients) | |||
745 | uint32_t to_comp = 974536; | 750 | uint32_t to_comp = 974536; |
746 | 751 | ||
747 | for (i = 0; i < NUM_TOXES; ++i) { | 752 | for (i = 0; i < NUM_TOXES; ++i) { |
748 | toxes[i] = tox_new(0, 0, 0, 0); | 753 | toxes[i] = tox_new(0, 0); |
749 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); | 754 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); |
750 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); | 755 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); |
751 | } | 756 | } |
@@ -832,7 +837,7 @@ START_TEST(test_many_clients_tcp) | |||
832 | opts.udp_enabled = 0; | 837 | opts.udp_enabled = 0; |
833 | } | 838 | } |
834 | 839 | ||
835 | toxes[i] = tox_new(&opts, 0, 0, 0); | 840 | toxes[i] = tox_new(&opts, 0); |
836 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); | 841 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); |
837 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); | 842 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); |
838 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; | 843 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; |
@@ -926,7 +931,7 @@ START_TEST(test_many_clients_tcp_b) | |||
926 | opts.udp_enabled = 0; | 931 | opts.udp_enabled = 0; |
927 | } | 932 | } |
928 | 933 | ||
929 | toxes[i] = tox_new(&opts, 0, 0, 0); | 934 | toxes[i] = tox_new(&opts, 0); |
930 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); | 935 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); |
931 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); | 936 | tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); |
932 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; | 937 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; |
@@ -1062,7 +1067,7 @@ START_TEST(test_many_group) | |||
1062 | uint32_t to_comp = 234212; | 1067 | uint32_t to_comp = 234212; |
1063 | 1068 | ||
1064 | for (i = 0; i < NUM_GROUP_TOX; ++i) { | 1069 | for (i = 0; i < NUM_GROUP_TOX; ++i) { |
1065 | toxes[i] = tox_new(0, 0, 0, 0); | 1070 | toxes[i] = tox_new(0, 0); |
1066 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); | 1071 | ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); |
1067 | tox_callback_friend_request(toxes[i], &g_accept_friend_request, &to_comp); | 1072 | tox_callback_friend_request(toxes[i], &g_accept_friend_request, &to_comp); |
1068 | tox_callback_group_invite(toxes[i], &print_group_invite_callback, &to_comp); | 1073 | tox_callback_group_invite(toxes[i], &print_group_invite_callback, &to_comp); |