diff options
-rw-r--r-- | auto_tests/tox_test.c | 19 | ||||
-rw-r--r-- | toxcore/group.c | 2 |
2 files changed, 19 insertions, 2 deletions
diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 22528330..501c93dc 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c | |||
@@ -357,6 +357,23 @@ START_TEST(test_one) | |||
357 | tox_self_get_name(tox2, new_name); | 357 | tox_self_get_name(tox2, new_name); |
358 | ck_assert_msg(memcmp(name, new_name, TOX_MAX_NAME_LENGTH) == 0, "Wrong name"); | 358 | ck_assert_msg(memcmp(name, new_name, TOX_MAX_NAME_LENGTH) == 0, "Wrong name"); |
359 | 359 | ||
360 | uint8_t sk[TOX_SECRET_KEY_SIZE]; | ||
361 | tox_self_get_secret_key(tox2, sk); | ||
362 | tox_kill(tox2); | ||
363 | |||
364 | tox_options_default(&options); | ||
365 | options.savedata_type = TOX_SAVEDATA_TYPE_SECRET_KEY; | ||
366 | options.savedata_data = sk; | ||
367 | options.savedata_length = sizeof(sk); | ||
368 | tox2 = tox_new(&options, &err_n); | ||
369 | ck_assert_msg(err_n == TOX_ERR_NEW_OK, "Load failed"); | ||
370 | uint8_t address3[TOX_ADDRESS_SIZE]; | ||
371 | tox_self_get_address(tox2, address3); | ||
372 | ck_assert_msg(memcmp(address3, address, TOX_PUBLIC_KEY_SIZE) == 0, "Wrong public key."); | ||
373 | uint8_t pk[TOX_PUBLIC_KEY_SIZE]; | ||
374 | tox_self_get_public_key(tox2, pk); | ||
375 | ck_assert_msg(memcmp(pk, address, TOX_PUBLIC_KEY_SIZE) == 0, "Wrong public key."); | ||
376 | |||
360 | tox_kill(tox1); | 377 | tox_kill(tox1); |
361 | tox_kill(tox2); | 378 | tox_kill(tox2); |
362 | } | 379 | } |
@@ -1194,7 +1211,7 @@ Suite *tox_suite(void) | |||
1194 | 1211 | ||
1195 | DEFTESTCASE(one); | 1212 | DEFTESTCASE(one); |
1196 | DEFTESTCASE_SLOW(few_clients, 50); | 1213 | DEFTESTCASE_SLOW(few_clients, 50); |
1197 | DEFTESTCASE_SLOW(many_clients, 150); | 1214 | DEFTESTCASE_SLOW(many_clients, 80); |
1198 | DEFTESTCASE_SLOW(many_clients_tcp, 20); | 1215 | DEFTESTCASE_SLOW(many_clients_tcp, 20); |
1199 | DEFTESTCASE_SLOW(many_clients_tcp_b, 20); | 1216 | DEFTESTCASE_SLOW(many_clients_tcp_b, 20); |
1200 | DEFTESTCASE_SLOW(many_group, 100); | 1217 | DEFTESTCASE_SLOW(many_group, 100); |
diff --git a/toxcore/group.c b/toxcore/group.c index c688ccff..af2cb492 100644 --- a/toxcore/group.c +++ b/toxcore/group.c | |||
@@ -1149,7 +1149,7 @@ int group_new_peer_send(const Group_Chats *g_c, int groupnumber, uint16_t peer_n | |||
1149 | * return 0 on success | 1149 | * return 0 on success |
1150 | * return -1 on failure | 1150 | * return -1 on failure |
1151 | */ | 1151 | */ |
1152 | int group_kill_peer_send(const Group_Chats *g_c, int groupnumber, uint16_t peer_num) | 1152 | static int group_kill_peer_send(const Group_Chats *g_c, int groupnumber, uint16_t peer_num) |
1153 | { | 1153 | { |
1154 | uint8_t packet[GROUP_MESSAGE_KILL_PEER_LENGTH]; | 1154 | uint8_t packet[GROUP_MESSAGE_KILL_PEER_LENGTH]; |
1155 | 1155 | ||