Commit 38f4c55f authored by DanmeiChen's avatar DanmeiChen
Browse files

fx tests ios

parent 6514a495
......@@ -477,7 +477,7 @@ static void lime_x3dh_message_test (bool_t with_composing, bool_t with_response,
if (sal_error) {
sal_set_send_error(linphone_core_get_sal(marie->lc), -1);
msg = _send_message(marieCr, "Bli bli bli");
const char *message_id = linphone_chat_message_get_message_id(msg);
char *message_id = ms_strdup(linphone_chat_message_get_message_id(msg));
BC_ASSERT_STRING_NOT_EQUAL(message_id, "");
wait_for_list(coresList, NULL, 0, 1000);
......@@ -487,6 +487,7 @@ static void lime_x3dh_message_test (bool_t with_composing, bool_t with_response,
const char *message_id_2 = linphone_chat_message_get_message_id(msg);
BC_ASSERT_STRING_NOT_EQUAL(message_id_2, "");
BC_ASSERT_STRING_EQUAL(message_id, message_id_2);
ms_free(message_id);
wait_for_list(coresList, NULL, 0, 1000);
......
......@@ -962,7 +962,7 @@ static void group_chat_room_message (bool_t encrypt, bool_t sal_error) {
if (sal_error) {
sal_set_send_error(linphone_core_get_sal(marie->lc), -1);
LinphoneChatMessage* msg = _send_message(marieCr, "Bli bli bli");
const char *message_id = linphone_chat_message_get_message_id(msg);
char *message_id = ms_strdup(linphone_chat_message_get_message_id(msg));
BC_ASSERT_STRING_NOT_EQUAL(message_id, "");
wait_for_list(coresList, NULL, 0, 1000);
......@@ -972,6 +972,7 @@ static void group_chat_room_message (bool_t encrypt, bool_t sal_error) {
const char *message_id_2 = linphone_chat_message_get_message_id(msg);
BC_ASSERT_STRING_NOT_EQUAL(message_id_2, "");
BC_ASSERT_STRING_EQUAL(message_id, message_id_2);
ms_free(message_id);
wait_for_list(coresList, NULL, 0, 1000);
......
......@@ -266,7 +266,11 @@ static void load_a_lot_of_chatrooms(void) {
MainDbProvider provider("db/chatrooms.db");
chrono::high_resolution_clock::time_point end = chrono::high_resolution_clock::now();
long ms = (long) chrono::duration_cast<chrono::milliseconds>(end - start).count();
#if __APPLE__
BC_ASSERT_LOWER(ms, 2000, long, "%li");
#else
BC_ASSERT_LOWER(ms, 1000, long, "%li");
#endif
}
test_t main_db_tests[] = {
......
......@@ -349,7 +349,7 @@ static void text_message_with_send_error(void) {
sal_set_send_error(linphone_core_get_sal(marie->lc), -1);
linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed);
linphone_chat_message_send(msg);
const char *message_id = linphone_chat_message_get_message_id(msg);
char *message_id = ms_strdup(linphone_chat_message_get_message_id(msg));
BC_ASSERT_STRING_NOT_EQUAL(message_id, "");
/* check transient msg list: the msg should be in it, and should be the only one */
......@@ -371,7 +371,10 @@ static void text_message_with_send_error(void) {
BC_ASSERT_STRING_NOT_EQUAL(message_id_2, "");
BC_ASSERT_STRING_NOT_EQUAL(message_id, message_id_2);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageDelivered,1));
ms_free(message_id);
// if imdn received before 200 ok, chat message will change directly state to DeliveredToUser from Inprogress.
//BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageDelivered,1));
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageDeliveredToUser,1));
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageReceived, 1, int, "%d");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment