mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 15:48:09 +00:00
fix potential crash in eventapi tester
This commit is contained in:
parent
83983ae9ac
commit
0bbfd5673b
1 changed files with 6 additions and 2 deletions
|
|
@ -186,7 +186,7 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes
|
|||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_subscribe(marie->lc,pauline->identity,"dodo",expires,content);
|
||||
|
||||
linphone_event_ref(lev);
|
||||
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionOutgoingProgress,1,1000));
|
||||
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionIncomingReceived,1,3000));
|
||||
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionActive,1,3000));
|
||||
|
|
@ -197,7 +197,10 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes
|
|||
|
||||
if (refresh_type==AutoRefresh){
|
||||
wait_for_list(lcs,NULL,0,6000);
|
||||
BC_ASSERT_EQUAL(linphone_event_get_subscription_state(pauline->lev), LinphoneSubscriptionActive, int, "%d");
|
||||
BC_ASSERT_PTR_NOT_NULL(pauline->lev);
|
||||
if (pauline->lev){
|
||||
BC_ASSERT_EQUAL(linphone_event_get_subscription_state(pauline->lev), LinphoneSubscriptionActive, int, "%d");
|
||||
}
|
||||
}else if (refresh_type==ManualRefresh){
|
||||
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionExpiring,1,4000));
|
||||
linphone_event_update_subscribe(lev,NULL);
|
||||
|
|
@ -215,6 +218,7 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes
|
|||
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionTerminated,1,1000));
|
||||
|
||||
bctbx_list_free(lcs);
|
||||
linphone_event_unref(lev);
|
||||
linphone_content_unref(content);
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue