Commit beae866a authored by Benjamin REIS's avatar Benjamin REIS
Browse files

really add group chat tester to the branch

parent c0e065bc
......@@ -175,6 +175,7 @@ set(SOURCE_FILES_C
dtmf_tester.c
eventapi_tester.c
flexisip_tester.c
group_chat_tester.c
liblinphone_tester.c
log_collection_tester.c
message_tester.c
......
......@@ -347,6 +347,12 @@ static void group_chat_room_creation_server (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateTerminationPending, initialPaulineStats.number_of_LinphoneChatRoomStateTerminationPending + 1, 100));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateTerminated, initialPaulineStats.number_of_LinphoneChatRoomStateTerminated + 1, 10000));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
linphone_core_delete_chat_room(chloe->lc, chloeCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -379,7 +385,7 @@ static void group_chat_room_send_message (void) {
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
check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Chloe's side and that the participants are added
LinphoneChatRoom *chloeCr = check_creation_chat_room_client_side(coresList, chloe, &initialChloeStats, confAddr, initialSubject, 2, 0);
......@@ -402,6 +408,11 @@ static void group_chat_room_send_message (void) {
BC_ASSERT_TRUE(linphone_address_weak_equal(chloeAddr, linphone_chat_message_get_from_address(marie->stat.last_received_chat_message)));
linphone_address_unref(chloeAddr);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(chloe->lc, chloeCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -437,13 +448,19 @@ static void group_chat_room_invite_multi_register_account (void) {
const LinphoneAddress *confAddr = linphone_chat_room_get_conference_address(marieCr);
// Check that the chat room is correctly created on Pauline1's side and that the participants are added
check_creation_chat_room_client_side(coresList, pauline1, &initialPauline1Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline1, &initialPauline1Stats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Pauline2's side and that the participants are added
check_creation_chat_room_client_side(coresList, pauline2, &initialPauline2Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr2 = check_creation_chat_room_client_side(coresList, pauline2, &initialPauline2Stats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline1->lc, paulineCr);
linphone_core_delete_chat_room(pauline2->lc, paulineCr2);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
......@@ -478,10 +495,10 @@ static void group_chat_room_add_admin (void) {
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
check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Marie designates Pauline as admin
LinphoneAddress *paulineAddr = linphone_address_new(linphone_core_get_identity(pauline->lc));
......@@ -494,6 +511,11 @@ static void group_chat_room_add_admin (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_participant_admin_statuses_changed, initialLaureStats.number_of_participant_admin_statuses_changed + 1, 1000));
BC_ASSERT_TRUE(linphone_participant_is_admin(paulineParticipant));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -529,7 +551,7 @@ static void group_chat_room_add_admin_non_admin (void) {
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Pauline designates Laure as admin
LinphoneAddress *laureAddr = linphone_address_new(linphone_core_get_identity(laure->lc));
......@@ -539,6 +561,11 @@ static void group_chat_room_add_admin_non_admin (void) {
linphone_chat_room_set_participant_admin_status(paulineCr, laureParticipant, TRUE);
BC_ASSERT_FALSE(linphone_participant_is_admin(laureParticipant));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -574,7 +601,7 @@ static void group_chat_room_remove_admin (void) {
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Marie designates Pauline as admin
LinphoneAddress *paulineAddr = linphone_address_new(linphone_core_get_identity(pauline->lc));
......@@ -598,6 +625,11 @@ static void group_chat_room_remove_admin (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_participant_admin_statuses_changed, initialLaureStats.number_of_participant_admin_statuses_changed + 2, 1000));
BC_ASSERT_FALSE(linphone_participant_is_admin(marieParticipant));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -646,6 +678,11 @@ static void group_chat_room_change_subject (void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(paulineCr), newSubject);
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(laureCr), newSubject);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -693,6 +730,11 @@ static void group_chat_room_change_subject_non_admin (void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(paulineCr), initialSubject);
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(laureCr), initialSubject);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -726,10 +768,10 @@ static void group_chat_room_remove_participant (void) {
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
check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Marie removes Laure from the chat room
LinphoneAddress *laureAddr = linphone_address_new(linphone_core_get_identity(laure->lc));
......@@ -741,6 +783,11 @@ static void group_chat_room_remove_participant (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_participants_removed, initialMarieStats.number_of_participants_removed + 1, 1000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_participants_removed, initialPaulineStats.number_of_participants_removed + 1, 1000));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -776,13 +823,18 @@ static void group_chat_room_leave (void) {
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
linphone_chat_room_leave(paulineCr);
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateTerminated, initialPaulineStats.number_of_LinphoneChatRoomStateTerminated + 1, 1000));
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_participants_removed, initialMarieStats.number_of_participants_removed + 1, 1000));
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_participants_removed, initialLaureStats.number_of_participants_removed + 1, 1000));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -838,6 +890,11 @@ static void group_chat_room_come_back_after_disconnection (void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(paulineCr), newSubject);
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(laureCr), newSubject);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -884,10 +941,15 @@ static void group_chat_room_create_room_with_disconnected_friends (void) {
linphone_core_set_network_reachable(laure->lc, TRUE);
// 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, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, confAddr, initialSubject, 2, 0);
// 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, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure, &initialLaureStats, confAddr, initialSubject, 2, 0);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
......@@ -954,6 +1016,11 @@ static void group_chat_room_reinvited_after_removed (void) {
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(newLaureCr), 2, int, "%d");
BC_ASSERT_STRING_EQUAL(linphone_chat_room_get_subject(newLaureCr), initialSubject);
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -1057,6 +1124,11 @@ static void group_chat_room_notify_after_disconnection (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_participant_admin_statuses_changed, initialPaulineStats.number_of_participant_admin_statuses_changed + 1, 1000));
BC_ASSERT_TRUE(linphone_participant_is_admin(laureParticipantFromPauline));
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -1097,13 +1169,13 @@ static void group_chat_room_send_refer_to_all_devices (void) {
participantsAddresses = NULL;
const LinphoneAddress *confAddr = linphone_chat_room_get_conference_address(marieCr);
/*LinphoneChatRoom *marie2Cr= */check_creation_chat_room_client_side(coresList, marie2, &initialMarie2Stats, confAddr, initialSubject, 2, 1);
LinphoneChatRoom *marieCr2= check_creation_chat_room_client_side(coresList, marie2, &initialMarie2Stats, confAddr, initialSubject, 2, 1);
// Check that the chat room is correctly created on Pauline's side and that the participants are added
LinphoneChatRoom *pauline1Cr = check_creation_chat_room_client_side(coresList, pauline1, &initialPauline1Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *pauline2Cr = check_creation_chat_room_client_side(coresList, pauline2, &initialPauline2Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr = check_creation_chat_room_client_side(coresList, pauline1, &initialPauline1Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *paulineCr2 = check_creation_chat_room_client_side(coresList, pauline2, &initialPauline2Stats, confAddr, initialSubject, 2, 0);
// Check that the chat room is correctly created on Laure's side and that the participants are added
/*LinphoneChatRoom *laure1Cr = */check_creation_chat_room_client_side(coresList, laure1, &initialLaure1Stats, confAddr, initialSubject, 2, 0);
LinphoneChatRoom *laureCr = check_creation_chat_room_client_side(coresList, laure1, &initialLaure1Stats, confAddr, initialSubject, 2, 0);
/*LinphoneChatRoom *laure2Cr = *///check_creation_chat_room_client_side(coresList, laure2, &initialLaure2Stats, confAddr, initialSubject, 2);
// Marie removes Laure from the chat room
......@@ -1120,8 +1192,15 @@ static void group_chat_room_send_refer_to_all_devices (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline2->stat.number_of_participants_removed, initialPauline2Stats.number_of_participants_removed + 1, 1000));
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(marieCr), 1, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(pauline1Cr), 1, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(pauline2Cr), 1, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 1, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr2), 1, int, "%d");
// Clean db from chat room
linphone_core_delete_chat_room(marie1->lc, marieCr);
linphone_core_delete_chat_room(marie2->lc, marieCr2);
linphone_core_delete_chat_room(laure1->lc, laureCr);
linphone_core_delete_chat_room(pauline1->lc, paulineCr);
linphone_core_delete_chat_room(pauline2->lc, paulineCr2);
wait_for_list(coresList, &dummy, 1, 1000);
bctbx_list_free(coresList);
......@@ -1247,6 +1326,14 @@ static void multiple_is_composing_notification(void) {
composing_addresses = linphone_chat_room_get_composing_addresses(paulineCr);
BC_ASSERT_EQUAL(bctbx_list_size(composing_addresses), 0, int, "%i");
// Clean db from chat room
linphone_core_delete_chat_room(marie->lc, marieCr);
linphone_core_delete_chat_room(laure->lc, laureCr);
linphone_core_delete_chat_room(pauline->lc, paulineCr);
wait_for_list(coresList,0, 1, 1500);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(laure);
......
......@@ -51,6 +51,7 @@ extern test_suite_t dtmf_test_suite;
extern test_suite_t event_test_suite;
extern test_suite_t main_db_test_suite;
extern test_suite_t flexisip_test_suite;
extern test_suite_t group_chat_test_suite;
extern test_suite_t log_collection_test_suite;
extern test_suite_t message_test_suite;
extern test_suite_t multi_call_test_suite;
......@@ -138,7 +139,6 @@ typedef struct _stats {
int number_of_LinphoneRegistrationFailed ;
int number_of_auth_info_requested ;
int number_of_LinphoneCallIncomingReceived;
int number_of_LinphoneCallOutgoingInit;
int number_of_LinphoneCallOutgoingProgress;
......@@ -183,6 +183,13 @@ typedef struct _stats {
int number_of_LinphoneIsComposingIdleReceived;
int progress_of_LinphoneFileTransfer;
int number_of_LinphoneChatRoomStateInstantiated;
int number_of_LinphoneChatRoomStateCreationPending;
int number_of_LinphoneChatRoomStateCreated;
int number_of_LinphoneChatRoomStateTerminationPending;
int number_of_LinphoneChatRoomStateTerminated;
int number_of_LinphoneChatRoomStateCreationFailed;
int number_of_IframeDecoded;
int number_of_NewSubscriptionRequest;
......@@ -275,6 +282,11 @@ typedef struct _stats {
int number_of_rtcp_generic_nack;
int number_of_tmmbr_received;
int last_tmmbr_value_received;
int number_of_participants_added;
int number_of_participant_admin_statuses_changed;
int number_of_participants_removed;
int number_of_subject_changed;
}stats;
......@@ -377,6 +389,7 @@ void liblinphone_tester_clock_start(MSTimeSpec *start);
bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms);
void linphone_core_manager_check_accounts(LinphoneCoreManager *m);
void account_manager_destroy(void);
LinphoneAddress *account_manager_get_identity_with_modified_identity(const LinphoneAddress *modified_identity);
LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data);
void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data);
......
[sip]
sip_port=-1
sip_tcp_port=-1
sip_tls_port=-1
default_proxy=0
ping_with_options=0
composing_idle_timeout=1
[auth_info_0]
username=chloe
userid=chloe
passwd=secret
realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_identity=sip:chloe@sip.example.org
reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0
[rtp]
audio_rtp_port=18070-28000
video_rtp_port=39072-49000
[video]
display=0
capture=0
show_local=0
size=qcif
enabled=0
self_view=0
automatically_initiate=0
automatically_accept=0
device=StaticImage: Static picture
[sound]
echocancellation=0 #to not overload cpu in case of VG
[net]
dns_srv_enabled=0 #no srv needed in general
stun_server=stun.linphone.org
......@@ -596,6 +596,7 @@ void liblinphone_tester_add_suites() {
#ifdef VCARD_ENABLED
bc_tester_add_suite(&vcard_test_suite);
#endif
bc_tester_add_suite(&group_chat_test_suite);
}
static int linphone_core_manager_get_max_audio_bw_base(const int array[],int array_size) {
......
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