Commit cbf99ae5 authored by jehan's avatar jehan
Browse files

fix presence test

parent 26c8f6ff
......@@ -203,8 +203,6 @@ static void simple_subscribe(void) {
CU_ASSERT_TRUE(subscribe_to_callee_presence(marie,pauline));
linphone_core_manager_destroy(marie);
CU_ASSERT_FALSE(wait_for(NULL,pauline->lc,&pauline->stat.number_of_NewSubscriptionRequest,2)); /*just to wait for unsubscription even if not notified*/
......@@ -262,7 +260,7 @@ static void presence_information(void) {
/* Presence activity without description. */
presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityDinner, NULL);
linphone_core_set_presence_model(pauline->lc, presence);
wait_core(marie->lc);
wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivityDinner,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphonePresenceActivityDinner, 1);
activity = linphone_presence_model_get_activity(marie->stat.last_received_presence);
CU_ASSERT_PTR_NOT_NULL(activity);
......@@ -273,7 +271,7 @@ static void presence_information(void) {
/* Presence activity with description. */
presence = linphone_presence_model_new_with_activity(LinphonePresenceActivitySteering, bike_description);
linphone_core_set_presence_model(pauline->lc, presence);
wait_core(marie->lc);
wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivitySteering,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphonePresenceActivitySteering, 1);
activity = linphone_presence_model_get_activity(marie->stat.last_received_presence);
CU_ASSERT_PTR_NOT_NULL(activity);
......@@ -285,7 +283,7 @@ static void presence_information(void) {
/* Presence activity with description and note. */
presence = linphone_presence_model_new_with_activity_and_note(LinphonePresenceActivityVacation, NULL, vacation_note, vacation_lang);
linphone_core_set_presence_model(pauline->lc, presence);
wait_core(marie->lc);
wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivityVacation,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphonePresenceActivityVacation, 1);
activity = linphone_presence_model_get_activity(marie->stat.last_received_presence);
CU_ASSERT_PTR_NOT_NULL(activity);
......@@ -306,7 +304,7 @@ static void presence_information(void) {
presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityOnThePhone, NULL);
linphone_presence_model_set_contact(presence, contact);
linphone_core_set_presence_model(pauline->lc, presence);
wait_core(marie->lc);
wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivityOnThePhone,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphonePresenceActivityOnThePhone, 1);
contact2 = linphone_presence_model_get_contact(presence);
CU_ASSERT_PTR_NOT_NULL(contact2);
......@@ -319,7 +317,7 @@ static void presence_information(void) {
current_timestamp = time(NULL);
presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityShopping, NULL);
linphone_core_set_presence_model(pauline->lc, presence);
wait_core(marie->lc);
wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivityShopping,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphonePresenceActivityShopping, 1);
presence_timestamp = linphone_presence_model_get_timestamp(presence);
CU_ASSERT_TRUE(presence_timestamp >= current_timestamp);
......
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