Commit 67af6475 authored by Matthieu Tanon's avatar Matthieu Tanon

Remove useless tests

parent ec193b12
......@@ -6025,141 +6025,6 @@ end:
linphone_core_manager_destroy(pauline);
}
static void group_chat_lime_x3dh_message_in_empty_chatroom (void) {
LinphoneCoreManager *marie = linphone_core_manager_create("marie_lime_x3dh_rc");
LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_lime_x3dh_rc");
bctbx_list_t *coresManagerList = NULL;
bctbx_list_t *participantsAddresses = NULL;
coresManagerList = bctbx_list_append(coresManagerList, marie);
coresManagerList = bctbx_list_append(coresManagerList, pauline);
int dummy = 0;
bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
start_core_for_conference(coresManagerList);
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline->lc)));
stats initialMarieStats = marie->stat;
stats initialPaulineStats = pauline->stat;
// Wait for lime users to be created on X3DH server
wait_for_list(coresList, &dummy, 1, x3dhServerDelay);
// Check encryption status for both participants
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(marie->lc));
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(pauline->lc));
// Marie creates a new group chat room
const char *initialSubject = "Friends";
LinphoneChatRoom *marieCr = create_chat_room_client_side(coresList, marie, &initialMarieStats, participantsAddresses, initialSubject, TRUE);
const LinphoneAddress *confAddr = linphone_chat_room_get_conference_address(marieCr);
// Check that the chat room is correctly created on Pauline's side and that the participants are added
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 1, 0);
// Marie sends a message
const char *marieMessage = "Hey ! What's up ?";
_send_message(marieCr, marieMessage);
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 1, 10000));
LinphoneChatMessage *paulineLastMsg = pauline->stat.last_received_chat_message;
if (!BC_ASSERT_PTR_NOT_NULL(paulineLastMsg))
goto end;
// Check that the message was correctly decrypted
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(paulineLastMsg), marieMessage);
LinphoneAddress *marieAddr = linphone_address_new(linphone_core_get_identity(marie->lc));
BC_ASSERT_TRUE(linphone_address_weak_equal(marieAddr, linphone_chat_message_get_from_address(paulineLastMsg)));
linphone_address_unref(marieAddr);
// Check chat room security level
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(marieCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(paulineCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
// Pauline leaves the chatroom
linphone_chat_room_leave(paulineCr);
marieMessage = "Are you there ?";
_send_message(marieCr, marieMessage);
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void group_chat_lime_x3dh_send_empty_message (void) {
LinphoneCoreManager *marie = linphone_core_manager_create("marie_lime_x3dh_rc");
LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_lime_x3dh_rc");
bctbx_list_t *coresManagerList = NULL;
bctbx_list_t *participantsAddresses = NULL;
coresManagerList = bctbx_list_append(coresManagerList, marie);
coresManagerList = bctbx_list_append(coresManagerList, pauline);
int dummy = 0;
bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
start_core_for_conference(coresManagerList);
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline->lc)));
stats initialMarieStats = marie->stat;
stats initialPaulineStats = pauline->stat;
// Wait for lime users to be created on X3DH server
wait_for_list(coresList, &dummy, 1, x3dhServerDelay);
// Check encryption status for both participants
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(marie->lc));
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(pauline->lc));
// Marie creates a new group chat room
const char *initialSubject = "Friends";
LinphoneChatRoom *marieCr = create_chat_room_client_side(coresList, marie, &initialMarieStats, participantsAddresses, initialSubject, TRUE);
const LinphoneAddress *confAddr = linphone_chat_room_get_conference_address(marieCr);
// Check that the chat room is correctly created on Pauline's side and that the participants are added
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 1, 0);
// Marie sends a message
const char *marieMessage = "";
_send_message(marieCr, marieMessage);
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 1, 10000));
LinphoneChatMessage *paulineLastMsg = pauline->stat.last_received_chat_message;
if (!BC_ASSERT_PTR_NOT_NULL(paulineLastMsg))
goto end;
// Check that the message was correctly decrypted
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(paulineLastMsg), marieMessage);
LinphoneAddress *marieAddr = linphone_address_new(linphone_core_get_identity(marie->lc));
BC_ASSERT_TRUE(linphone_address_weak_equal(marieAddr, linphone_chat_message_get_from_address(paulineLastMsg)));
linphone_address_unref(marieAddr);
// Check chat room security level
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(marieCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(paulineCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
marieMessage = " ";
_send_message(marieCr, marieMessage);
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
test_t group_chat_tests[] = {
TEST_NO_TAG("Group chat room creation server", group_chat_room_creation_server),
TEST_ONE_TAG("Add participant", group_chat_room_add_participant, "LeaksMemory"),
......@@ -6234,8 +6099,6 @@ test_t group_chat_tests[] = {
TEST_TWO_TAGS("LIME X3DH message to multidevice participants", group_chat_lime_x3dh_send_encrypted_message_to_multidevice_participants, "LimeX3DH", "LeaksMemory"),
TEST_TWO_TAGS("LIME X3DH messages while network unreachable", group_chat_lime_x3dh_message_while_network_unreachable, "LimeX3DH", "LeaksMemory"),
TEST_TWO_TAGS("LIME X3DH update keys", group_chat_lime_x3dh_update_keys, "LimeX3DH", "LeaksMemory"),
TEST_TWO_TAGS("LIME X3DH message in empty chatroom", group_chat_lime_x3dh_message_in_empty_chatroom, "LimeX3DH", "LeaksMemory"),
TEST_TWO_TAGS("LIME X3DH send empty message", group_chat_lime_x3dh_send_empty_message, "LimeX3DH", "LeaksMemory"),
};
test_suite_t group_chat_test_suite = {
......
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