mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed a test.
Removed function from Messenger.h
This commit is contained in:
parent
9c6a8432ce
commit
496d4fe203
|
@ -299,27 +299,6 @@ START_TEST(test_messenger_state_saveloadsave)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_messenger_state_saveload_encrypted)
|
||||
{
|
||||
uint8_t addr[FRIEND_ADDRESS_SIZE];
|
||||
getaddress(m, addr);
|
||||
Messenger *m_temp = new_messenger(TOX_ENABLE_IPV6_DEFAULT);
|
||||
|
||||
size_t size = messenger_size_encrypted(m);
|
||||
uint8_t buffer[size];
|
||||
messenger_save_encrypted(m, buffer, "Gentoo", sizeof("Gentoo"));
|
||||
|
||||
ck_assert_msg(messenger_load_encrypted(m_temp, buffer, size, "Ubuntu", sizeof("Ubuntu")) == -1,
|
||||
"Bad password didn't make the function fail.");
|
||||
ck_assert_msg(messenger_load_encrypted(m_temp, buffer, size, "Gentoo", sizeof("Gentoo")) == 0,
|
||||
"Good password didn't make the function succeed.");
|
||||
uint8_t addr1[FRIEND_ADDRESS_SIZE];
|
||||
getaddress(m_temp, addr1);
|
||||
ck_assert_msg(memcmp(addr1, addr, FRIEND_ADDRESS_SIZE) == 0, "Didn't load messenger successfully");
|
||||
kill_messenger(m_temp);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
#define DEFTESTCASE(NAME) \
|
||||
TCase *tc_##NAME = tcase_create(#NAME); \
|
||||
tcase_add_test(tc_##NAME, test_##NAME); \
|
||||
|
@ -331,7 +310,6 @@ Suite *messenger_suite(void)
|
|||
|
||||
DEFTESTCASE(dht_state_saveloadsave);
|
||||
DEFTESTCASE(messenger_state_saveloadsave);
|
||||
DEFTESTCASE(messenger_state_saveload_encrypted);
|
||||
|
||||
DEFTESTCASE(getself_name);
|
||||
DEFTESTCASE(m_get_userstatus_size);
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
static void set_friend_status(Messenger *m, int32_t friendnumber, uint8_t status);
|
||||
static int write_cryptpacket_id(Messenger *m, int32_t friendnumber, uint8_t packet_id, uint8_t *data, uint32_t length);
|
||||
|
||||
static IP_Port get_friend_ipport(Messenger *m, int32_t friendnumber);
|
||||
|
||||
// friend_not_valid determines if the friendnumber passed is valid in the Messenger object
|
||||
static uint8_t friend_not_valid(Messenger *m, int32_t friendnumber)
|
||||
{
|
||||
|
@ -875,7 +877,7 @@ static uint8_t groupnumber_not_valid(Messenger *m, int groupnumber)
|
|||
/* returns valid ip port of connected friend on success
|
||||
* returns zeroed out IP_Port on failure
|
||||
*/
|
||||
IP_Port get_friend_ipport(Messenger *m, int32_t friendnumber)
|
||||
static IP_Port get_friend_ipport(Messenger *m, int32_t friendnumber)
|
||||
{
|
||||
IP_Port zero;
|
||||
memset(&zero, 0, sizeof(zero));
|
||||
|
|
|
@ -373,11 +373,6 @@ int getname(Messenger *m, int32_t friendnumber, uint8_t *name);
|
|||
int m_get_name_size(Messenger *m, int32_t friendnumber);
|
||||
int m_get_self_name_size(Messenger *m);
|
||||
|
||||
/* returns valid ip port of connected friend on success
|
||||
* returns zeroed out IP_Port on failure
|
||||
*/
|
||||
IP_Port get_friend_ipport(Messenger *m, int32_t friendnumber);
|
||||
|
||||
/* Set our user status.
|
||||
* You are responsible for freeing status after.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user