summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-01-18 18:35:28 -0500
committerirungentoo <irungentoo@gmail.com>2014-01-18 18:35:28 -0500
commit99ae23813b47cc5198a210c4ea8da54d8a817829 (patch)
tree8ed427536060671022841e1f60fff661e2f7e6ee /auto_tests
parent8d1ef66892f06b2a1f564b9cc95cca6387763762 (diff)
Some optimizations and fixes.
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/tox_test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c
index 310419d6..eb8ccf87 100644
--- a/auto_tests/tox_test.c
+++ b/auto_tests/tox_test.c
@@ -59,7 +59,7 @@ START_TEST(test_few_clients)
59 tox_callback_friend_request(tox2, accept_friend_request, tox2); 59 tox_callback_friend_request(tox2, accept_friend_request, tox2);
60 uint8_t address[TOX_FRIEND_ADDRESS_SIZE]; 60 uint8_t address[TOX_FRIEND_ADDRESS_SIZE];
61 tox_get_address(tox2, address); 61 tox_get_address(tox2, address);
62 int test = tox_add_friend(tox3, address, "Gentoo", 7); 62 int test = tox_add_friend(tox3, address, (uint8_t *)"Gentoo", 7);
63 ck_assert_msg(test == 0, "Failed to add friend error code: %i", test); 63 ck_assert_msg(test == 0, "Failed to add friend error code: %i", test);
64 64
65 uint8_t off = 1; 65 uint8_t off = 1;
@@ -84,7 +84,7 @@ START_TEST(test_few_clients)
84 printf("tox clients connected\n"); 84 printf("tox clients connected\n");
85 uint32_t to_compare = 974536; 85 uint32_t to_compare = 974536;
86 tox_callback_friend_message(tox3, print_message, &to_compare); 86 tox_callback_friend_message(tox3, print_message, &to_compare);
87 tox_send_message(tox2, 0, "Install Gentoo", sizeof("Install Gentoo")); 87 tox_send_message(tox2, 0, (uint8_t *)"Install Gentoo", sizeof("Install Gentoo"));
88 88
89 while (1) { 89 while (1) {
90 messages_received = 0; 90 messages_received = 0;
@@ -101,7 +101,7 @@ START_TEST(test_few_clients)
101 printf("tox clients messaging succeeded\n"); 101 printf("tox clients messaging succeeded\n");
102 102
103 tox_callback_name_change(tox3, print_nickchange, &to_compare); 103 tox_callback_name_change(tox3, print_nickchange, &to_compare);
104 tox_set_name(tox2, "Gentoo", sizeof("Gentoo")); 104 tox_set_name(tox2, (uint8_t *)"Gentoo", sizeof("Gentoo"));
105 105
106 while (1) { 106 while (1) {
107 name_changes = 0; 107 name_changes = 0;
@@ -122,8 +122,8 @@ START_TEST(test_few_clients)
122} 122}
123END_TEST 123END_TEST
124 124
125#define NUM_TOXES 66 125#define NUM_TOXES 33
126#define NUM_FRIENDS 20 126#define NUM_FRIENDS 10
127 127
128START_TEST(test_many_clients) 128START_TEST(test_many_clients)
129{ 129{
@@ -149,7 +149,7 @@ loop_top:
149 pairs[i].tox1 = rand() % NUM_TOXES; 149 pairs[i].tox1 = rand() % NUM_TOXES;
150 pairs[i].tox2 = (pairs[i].tox1 + rand() % (NUM_TOXES - 1) + 1) % NUM_TOXES; 150 pairs[i].tox2 = (pairs[i].tox1 + rand() % (NUM_TOXES - 1) + 1) % NUM_TOXES;
151 tox_get_address(toxes[pairs[i].tox1], address); 151 tox_get_address(toxes[pairs[i].tox1], address);
152 int test = tox_add_friend(toxes[pairs[i].tox2], address, "Gentoo", 7); 152 int test = tox_add_friend(toxes[pairs[i].tox2], address, (uint8_t *)"Gentoo", 7);
153 153
154 if (test == TOX_FAERR_ALREADYSENT) { 154 if (test == TOX_FAERR_ALREADYSENT) {
155 goto loop_top; 155 goto loop_top;