Commit 0bbfd567 authored by Simon Morlat's avatar Simon Morlat

fix potential crash in eventapi tester

parent 83983ae9
......@@ -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);
......
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