mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 16:09:20 +00:00
add new checks for ErrorInfo mechanism
This commit is contained in:
parent
9d31ca0e5d
commit
cf25820aec
2 changed files with 27 additions and 1 deletions
|
|
@ -111,6 +111,8 @@ static void subscribe_test_declined(void) {
|
|||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
|
||||
LinphoneContent content={0};
|
||||
LinphoneEvent *lev;
|
||||
const LinphoneErrorInfo *ei;
|
||||
MSList* lcs=ms_list_append(NULL,marie->lc);
|
||||
lcs=ms_list_append(lcs,pauline->lc);
|
||||
|
||||
|
|
@ -122,13 +124,21 @@ static void subscribe_test_declined(void) {
|
|||
|
||||
pauline->decline_subscribe=TRUE;
|
||||
|
||||
linphone_core_subscribe(marie->lc,pauline->identity,"dodo",600,&content);
|
||||
lev=linphone_core_subscribe(marie->lc,pauline->identity,"dodo",600,&content);
|
||||
linphone_event_ref(lev);
|
||||
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionOutgoingInit,1,1000));
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionIncomingReceived,1,1000));
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionError,1,21000));/*yes flexisip may wait 20 secs in case of forking*/
|
||||
ei=linphone_event_get_error_info(lev);
|
||||
CU_ASSERT_PTR_NOT_NULL(ei);
|
||||
if (ei){
|
||||
CU_ASSERT_EQUAL(linphone_error_info_get_protocol_code(ei),603);
|
||||
CU_ASSERT_PTR_NOT_NULL(linphone_error_info_get_phrase(ei));
|
||||
}
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionTerminated,1,1000));
|
||||
|
||||
linphone_event_unref(lev);
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,6 +356,22 @@ static void authenticated_register_with_wrong_credentials_with_params(const char
|
|||
/*wait for retry*/
|
||||
CU_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&counters->number_of_auth_info_requested,4));
|
||||
CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,1);
|
||||
|
||||
/*check the detailed error info */
|
||||
if (!user_agent || strcmp(user_agent,"tester-no-403")!=0){
|
||||
LinphoneProxyConfig *cfg=NULL;
|
||||
linphone_core_get_default_proxy(mgr->lc,&cfg);
|
||||
CU_ASSERT_PTR_NOT_NULL(cfg);
|
||||
if (cfg){
|
||||
const LinphoneErrorInfo *ei=linphone_proxy_config_get_error_info(cfg);
|
||||
const char *phrase=linphone_error_info_get_phrase(ei);
|
||||
CU_ASSERT_PTR_NOT_NULL(phrase);
|
||||
if (phrase) CU_ASSERT_TRUE(strcmp(phrase,"Forbidden")==0);
|
||||
CU_ASSERT_EQUAL(linphone_error_info_get_protocol_code(ei),403);
|
||||
CU_ASSERT_PTR_NULL(linphone_error_info_get_details(ei));
|
||||
}
|
||||
|
||||
}
|
||||
linphone_core_manager_destroy(mgr);
|
||||
}
|
||||
static void authenticated_register_with_wrong_credentials() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue