summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-02-27 20:33:43 -0500
committerirungentoo <irungentoo@gmail.com>2015-02-27 20:33:43 -0500
commitd015879cd3d24ddc8f81964b64d0ce199cd75913 (patch)
tree6ddba450b31bae71d38b76927d68ed7241b8020f /auto_tests
parentc5b03cdd9a5c24d31870dfd474507a097f93b60b (diff)
Test fixes.
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/tox_test.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c
index d9cb46db..d7a44fb2 100644
--- a/auto_tests/tox_test.c
+++ b/auto_tests/tox_test.c
@@ -503,13 +503,13 @@ END_TEST
503 503
504#define NUM_GROUP_TOX 32 504#define NUM_GROUP_TOX 32
505 505
506void g_accept_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, uint16_t length, void *userdata) 506void g_accept_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata)
507{ 507{
508 if (*((uint32_t *)userdata) != 234212) 508 if (*((uint32_t *)userdata) != 234212)
509 return; 509 return;
510 510
511 if (length == 7 && memcmp("Gentoo", data, 7) == 0) { 511 if (length == 7 && memcmp("Gentoo", data, 7) == 0) {
512 tox_add_friend_norequest(m, public_key); 512 tox_friend_add_norequest(m, public_key, 0);
513 } 513 }
514} 514}
515 515
@@ -560,24 +560,24 @@ START_TEST(test_many_group)
560 uint32_t to_comp = 234212; 560 uint32_t to_comp = 234212;
561 561
562 for (i = 0; i < NUM_GROUP_TOX; ++i) { 562 for (i = 0; i < NUM_GROUP_TOX; ++i) {
563 toxes[i] = tox_new(0); 563 toxes[i] = tox_new(0, 0, 0, 0);
564 ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); 564 ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i);
565 tox_callback_friend_request(toxes[i], &g_accept_friend_request, &to_comp); 565 tox_callback_friend_request(toxes[i], &g_accept_friend_request, &to_comp);
566 tox_callback_group_invite(toxes[i], &print_group_invite_callback, &to_comp); 566 tox_callback_group_invite(toxes[i], &print_group_invite_callback, &to_comp);
567 } 567 }
568 568
569 uint8_t address[TOX_FRIEND_ADDRESS_SIZE]; 569 uint8_t address[TOX_ADDRESS_SIZE];
570 tox_get_address(toxes[NUM_GROUP_TOX - 1], address); 570 tox_self_get_address(toxes[NUM_GROUP_TOX - 1], address);
571 571
572 for (i = 0; i < NUM_GROUP_TOX; ++i) { 572 for (i = 0; i < NUM_GROUP_TOX; ++i) {
573 ck_assert_msg(tox_add_friend(toxes[i], address, (uint8_t *)"Gentoo", 7) == 0, "Failed to add friend"); 573 ck_assert_msg(tox_friend_add(toxes[i], address, (uint8_t *)"Gentoo", 7, 0) == 0, "Failed to add friend");
574 574
575 tox_get_address(toxes[i], address); 575 tox_self_get_address(toxes[i], address);
576 } 576 }
577 577
578 while (1) { 578 while (1) {
579 for (i = 0; i < NUM_GROUP_TOX; ++i) { 579 for (i = 0; i < NUM_GROUP_TOX; ++i) {
580 if (tox_get_friend_connection_status(toxes[i], 0) != 1) { 580 if (tox_friend_get_connection_status(toxes[i], 0, 0) != TOX_CONNECTION_UDP) {
581 break; 581 break;
582 } 582 }
583 } 583 }
@@ -586,7 +586,7 @@ START_TEST(test_many_group)
586 break; 586 break;
587 587
588 for (i = 0; i < NUM_GROUP_TOX; ++i) { 588 for (i = 0; i < NUM_GROUP_TOX; ++i) {
589 tox_do(toxes[i]); 589 tox_iteration(toxes[i]);
590 } 590 }
591 591
592 c_sleep(50); 592 c_sleep(50);
@@ -604,7 +604,7 @@ START_TEST(test_many_group)
604 604
605 while (1) { 605 while (1) {
606 for (i = 0; i < NUM_GROUP_TOX; ++i) { 606 for (i = 0; i < NUM_GROUP_TOX; ++i) {
607 tox_do(toxes[i]); 607 tox_iteration(toxes[i]);
608 } 608 }
609 609
610 if (!invite_counter) { 610 if (!invite_counter) {
@@ -642,7 +642,7 @@ START_TEST(test_many_group)
642 642
643 for (j = 0; j < 20; ++j) { 643 for (j = 0; j < 20; ++j) {
644 for (i = 0; i < NUM_GROUP_TOX; ++i) { 644 for (i = 0; i < NUM_GROUP_TOX; ++i) {
645 tox_do(toxes[i]); 645 tox_iteration(toxes[i]);
646 } 646 }
647 647
648 c_sleep(50); 648 c_sleep(50);
@@ -655,7 +655,7 @@ START_TEST(test_many_group)
655 655
656 for (j = 0; j < 10; ++j) { 656 for (j = 0; j < 10; ++j) {
657 for (i = 0; i < NUM_GROUP_TOX; ++i) { 657 for (i = 0; i < NUM_GROUP_TOX; ++i) {
658 tox_do(toxes[i]); 658 tox_iteration(toxes[i]);
659 } 659 }
660 660
661 c_sleep(50); 661 c_sleep(50);