diff options
Diffstat (limited to 'auto_tests')
-rw-r--r-- | auto_tests/tox_test.c | 19 |
1 files changed, 18 insertions, 1 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); |