mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
add test for register with username with espace
This commit is contained in:
parent
675eb02a52
commit
7b4156981d
1 changed files with 41 additions and 0 deletions
|
|
@ -422,6 +422,46 @@ static void authenticated_register_with_provided_credentials(void){
|
|||
linphone_core_manager_destroy(lcm);
|
||||
}
|
||||
|
||||
static void authenticated_register_with_provided_credentials_and_username_with_espace(void){
|
||||
LinphoneCoreManager *lcm;
|
||||
stats* counters;
|
||||
LinphoneProxyConfig *cfg;
|
||||
char route[256];
|
||||
LinphoneAddress *from;
|
||||
char *addr;
|
||||
LinphoneAuthInfo *ai;
|
||||
const char* username = "test username";
|
||||
sprintf(route,"sip:%s",test_route);
|
||||
|
||||
lcm = linphone_core_manager_new(NULL);
|
||||
|
||||
counters = get_stats(lcm->lc);
|
||||
cfg = linphone_core_create_proxy_config(lcm->lc);
|
||||
from = create_linphone_address_with_username(auth_domain,username);
|
||||
|
||||
linphone_proxy_config_set_identity(cfg, addr=linphone_address_as_string(from));
|
||||
ms_free(addr);
|
||||
|
||||
linphone_proxy_config_enable_register(cfg,TRUE);
|
||||
linphone_proxy_config_set_expires(cfg,1);
|
||||
linphone_proxy_config_set_route(cfg, test_route);
|
||||
linphone_proxy_config_set_server_addr(cfg,test_route);
|
||||
linphone_address_unref(from);
|
||||
|
||||
ai = linphone_auth_info_new(username, NULL, test_password, NULL, NULL, NULL);
|
||||
linphone_core_add_auth_info(lcm->lc, ai);
|
||||
linphone_auth_info_unref(ai);
|
||||
linphone_core_add_proxy_config(lcm->lc, cfg);
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,1));
|
||||
BC_ASSERT_EQUAL(counters->number_of_auth_info_requested,0, int, "%d");
|
||||
|
||||
BC_ASSERT_PTR_NULL(lp_config_get_string(lcm->lc->config, "auth_info_0", "passwd", NULL));
|
||||
BC_ASSERT_PTR_NOT_NULL(lp_config_get_string(lcm->lc->config, "auth_info_0", "ha1", NULL));
|
||||
|
||||
linphone_proxy_config_destroy(cfg);
|
||||
linphone_core_manager_destroy(lcm);
|
||||
}
|
||||
static void authenticated_register_with_wrong_late_credentials(void){
|
||||
LinphoneCoreManager *lcm;
|
||||
stats* counters;
|
||||
|
|
@ -1267,6 +1307,7 @@ test_t register_tests[] = {
|
|||
TEST_NO_TAG("Authenticated register with wrong late credentials", authenticated_register_with_wrong_late_credentials),
|
||||
TEST_NO_TAG("Authenticated register with late credentials", authenticated_register_with_late_credentials),
|
||||
TEST_NO_TAG("Authenticated register with provided credentials", authenticated_register_with_provided_credentials),
|
||||
TEST_NO_TAG("Authenticated register with provided credentials, username with espace", authenticated_register_with_provided_credentials_and_username_with_espace),
|
||||
TEST_NO_TAG("Register with refresh", simple_register_with_refresh),
|
||||
TEST_NO_TAG("Authenticated register with refresh", simple_auth_register_with_refresh),
|
||||
TEST_NO_TAG("Register with refresh and send error", register_with_refresh_with_send_error),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue