Reactivate "Add participant" group chat tester.

This commit is contained in:
Ghislain MARY 2018-02-28 12:09:31 +01:00
parent 587e951845
commit c9d5db0309

View file

@ -462,13 +462,11 @@ static void group_chat_room_creation_server (void) {
linphone_core_manager_destroy(chloe); linphone_core_manager_destroy(chloe);
} }
#if 0
static void group_chat_room_add_participant (void) { static void group_chat_room_add_participant (void) {
LinphoneCoreManager *marie = linphone_core_manager_create("marie_rc"); LinphoneCoreManager *marie = linphone_core_manager_create("marie_rc");
LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_rc"); LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_rc");
LinphoneCoreManager *laure = linphone_core_manager_create("laure_tcp_rc"); LinphoneCoreManager *laure = linphone_core_manager_create("laure_tcp_rc");
LinphoneCoreManager *chloe = linphone_core_manager_create("chloe_rc"); LinphoneCoreManager *chloe = linphone_core_manager_create("chloe_rc");
bctbx_list_t *coresManagerList = NULL; bctbx_list_t *coresManagerList = NULL;
bctbx_list_t *participantsAddresses = NULL; bctbx_list_t *participantsAddresses = NULL;
coresManagerList = bctbx_list_append(coresManagerList, marie); coresManagerList = bctbx_list_append(coresManagerList, marie);
@ -476,10 +474,9 @@ static void group_chat_room_add_participant (void) {
coresManagerList = bctbx_list_append(coresManagerList, laure); coresManagerList = bctbx_list_append(coresManagerList, laure);
coresManagerList = bctbx_list_append(coresManagerList, chloe); coresManagerList = bctbx_list_append(coresManagerList, chloe);
bctbx_list_t *coresList = init_core_for_conference(coresManagerList); bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
linphone_core_set_linphone_specs(chloe->lc, ""); //disable group chat for chloe linphone_core_set_linphone_specs(chloe->lc, ""); // Disable group chat for Chloe
start_core_for_conference(coresManagerList); start_core_for_conference(coresManagerList);
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(marie->lc))); participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(marie->lc)));
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(laure->lc))); participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(laure->lc)));
stats initialMarieStats = marie->stat; stats initialMarieStats = marie->stat;
@ -498,7 +495,7 @@ static void group_chat_room_add_participant (void) {
// Check that the chat room is correctly created on Laure's side and that the participants are added // Check that the chat room is correctly created on Laure's side and that the participants are added
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, FALSE); LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, FALSE);
//to simulate dialog removal for pauline // To simulate dialog removal for Pauline
linphone_core_set_network_reachable(pauline->lc, FALSE); linphone_core_set_network_reachable(pauline->lc, FALSE);
coresList=bctbx_list_remove(coresList, pauline->lc); coresList=bctbx_list_remove(coresList, pauline->lc);
linphone_core_manager_reinit(pauline); linphone_core_manager_reinit(pauline);
@ -517,7 +514,7 @@ static void group_chat_room_add_participant (void) {
bctbx_list_free_with_data(participantsAddresses, (bctbx_list_free_func)linphone_address_unref); bctbx_list_free_with_data(participantsAddresses, (bctbx_list_free_func)linphone_address_unref);
participantsAddresses = NULL; participantsAddresses = NULL;
//refused by server because group chat disabled for chloe // Refused by server because group chat disabled for Chloe
BC_ASSERT_FALSE(wait_for_list(coresList, &marie->stat.number_of_participants_added, initialMarieStats.number_of_participants_added + 1, 1000)); BC_ASSERT_FALSE(wait_for_list(coresList, &marie->stat.number_of_participants_added, initialMarieStats.number_of_participants_added + 1, 1000));
BC_ASSERT_FALSE(wait_for_list(coresList, &pauline->stat.number_of_participants_added, initialPaulineStats.number_of_participants_added + 1, 1000)); BC_ASSERT_FALSE(wait_for_list(coresList, &pauline->stat.number_of_participants_added, initialPaulineStats.number_of_participants_added + 1, 1000));
BC_ASSERT_FALSE(wait_for_list(coresList, &laure->stat.number_of_participants_added, initialLaureStats.number_of_participants_added + 1, 1000)); BC_ASSERT_FALSE(wait_for_list(coresList, &laure->stat.number_of_participants_added, initialLaureStats.number_of_participants_added + 1, 1000));
@ -530,10 +527,9 @@ static void group_chat_room_add_participant (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneIsComposingActiveReceived, initialMarieStats.number_of_LinphoneIsComposingActiveReceived + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneIsComposingActiveReceived, initialMarieStats.number_of_LinphoneIsComposingActiveReceived + 1, 10000));
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneIsComposingActiveReceived, initialPaulineStats.number_of_LinphoneIsComposingActiveReceived + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneIsComposingActiveReceived, initialPaulineStats.number_of_LinphoneIsComposingActiveReceived + 1, 10000));
// Now, Chloe is upgrading to group chat client
//Now, chloe is upgrading to group chat client
linphone_core_set_network_reachable(chloe->lc, FALSE); linphone_core_set_network_reachable(chloe->lc, FALSE);
coresList=bctbx_list_remove(coresList, chloe->lc); coresList = bctbx_list_remove(coresList, chloe->lc);
linphone_core_manager_reinit(chloe); linphone_core_manager_reinit(chloe);
tmpCoresManagerList = bctbx_list_append(NULL, chloe); tmpCoresManagerList = bctbx_list_append(NULL, chloe);
init_core_for_conference(tmpCoresManagerList); init_core_for_conference(tmpCoresManagerList);
@ -575,7 +571,6 @@ static void group_chat_room_add_participant (void) {
linphone_core_manager_destroy(laure); linphone_core_manager_destroy(laure);
linphone_core_manager_destroy(chloe); linphone_core_manager_destroy(chloe);
} }
#endif
static int im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg) { static int im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg) {
if (linphone_chat_message_get_content_type(msg)) { if (linphone_chat_message_get_content_type(msg)) {
@ -2980,7 +2975,7 @@ end:
test_t group_chat_tests[] = { test_t group_chat_tests[] = {
TEST_TWO_TAGS("Group chat room creation server", group_chat_room_creation_server, "Server", "LeaksMemory"), TEST_TWO_TAGS("Group chat room creation server", group_chat_room_creation_server, "Server", "LeaksMemory"),
//TEST_TWO_TAGS("Add participant", group_chat_room_add_participant, "Server", "LeaksMemory"), TEST_TWO_TAGS("Add participant", group_chat_room_add_participant, "Server", "LeaksMemory"),
TEST_TWO_TAGS("Send message", group_chat_room_send_message, "Server", "LeaksMemory"), TEST_TWO_TAGS("Send message", group_chat_room_send_message, "Server", "LeaksMemory"),
TEST_TWO_TAGS("Send encrypted message", group_chat_room_send_message_encrypted, "Server", "LeaksMemory"), TEST_TWO_TAGS("Send encrypted message", group_chat_room_send_message_encrypted, "Server", "LeaksMemory"),
TEST_TWO_TAGS("Send invite on a multi register account", group_chat_room_invite_multi_register_account, "Server", "LeaksMemory"), TEST_TWO_TAGS("Send invite on a multi register account", group_chat_room_invite_multi_register_account, "Server", "LeaksMemory"),