Commit 9633a356 authored by Simon Morlat's avatar Simon Morlat

simplify tester

parent ad406033
......@@ -36,7 +36,7 @@ use LWP::UserAgent;
use strict;
use vars qw($opt_b $opt_f $opt_h $opt_i $opt_l $opt_n $opt_q $opt_t $opt_u $opt_v $opt_w);
my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
# If the OpenSSL commandline is not in search path you can configure it here!
my $openssl = 'openssl';
......
This diff is collapsed.
......@@ -77,8 +77,8 @@ void linphone_subscription_state_change(LinphoneCore *lc, LinphoneEvent *lev, Li
}
static void subscribe_test_declined(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneContent content;
MSList* lcs=ms_list_append(NULL,marie->lc);
lcs=ms_list_append(lcs,pauline->lc);
......@@ -104,8 +104,8 @@ static void subscribe_test_declined(void) {
static void subscribe_test_with_args(bool_t terminated_by_subscriber) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneContent content;
LinphoneEvent *lev;
MSList* lcs=ms_list_append(NULL,marie->lc);
......
......@@ -167,7 +167,7 @@ LinphoneCoreManager *get_manager(LinphoneCore *lc){
return manager;
}
LinphoneCoreManager* linphone_core_manager_new2(const char* path, const char* rc_file, int check_for_proxies) {
LinphoneCoreManager* linphone_core_manager_new2(const char* rc_file, int check_for_proxies) {
LinphoneCoreManager* mgr= ms_new0(LinphoneCoreManager,1);
LinphoneProxyConfig* proxy;
int proxy_count=check_for_proxies?(rc_file?1:0):0;
......@@ -185,7 +185,7 @@ LinphoneCoreManager* linphone_core_manager_new2(const char* path, const char* rc
mgr->v_table.info_received=info_message_received;
mgr->v_table.subscription_state_changed=linphone_subscription_state_change;
mgr->v_table.notify_received=linphone_notify_received;
mgr->lc=configure_lc_from(&mgr->v_table, path, rc_file);
mgr->lc=configure_lc_from(&mgr->v_table, liblinphone_tester_file_prefix, rc_file);
linphone_core_set_user_data(mgr->lc,mgr);
reset_counters(&mgr->stat);
/*CU_ASSERT_EQUAL(ms_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count);*/
......@@ -205,8 +205,8 @@ LinphoneCoreManager* linphone_core_manager_new2(const char* path, const char* rc
return mgr;
}
LinphoneCoreManager* linphone_core_manager_new(const char* path, const char* rc_file) {
return linphone_core_manager_new2(path, rc_file, TRUE);
LinphoneCoreManager* linphone_core_manager_new( const char* rc_file) {
return linphone_core_manager_new2(rc_file, TRUE);
}
void linphone_core_manager_stop(LinphoneCoreManager *mgr){
......
......@@ -156,8 +156,8 @@ typedef struct _LinphoneCoreManager {
bool_t decline_subscribe;
} LinphoneCoreManager;
LinphoneCoreManager* linphone_core_manager_new2(const char* path, const char* rc_file, int check_for_proxies);
LinphoneCoreManager* linphone_core_manager_new(const char * path, const char* rc_file);
LinphoneCoreManager* linphone_core_manager_new2(const char* rc_file, int check_for_proxies);
LinphoneCoreManager* linphone_core_manager_new(const char* rc_file);
void linphone_core_manager_stop(LinphoneCoreManager *mgr);
void linphone_core_manager_destroy(LinphoneCoreManager* mgr);
......
......@@ -62,8 +62,8 @@ void linphone_chat_message_state_change(LinphoneChatMessage* msg,LinphoneChatMes
}
static void text_message(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
char* to = linphone_address_as_string(marie->identity);
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(pauline->lc,to);
......@@ -80,8 +80,8 @@ static void text_message(void) {
}
static void text_message_with_privacy(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneProxyConfig* pauline_proxy;
char* to = linphone_address_as_string(marie->identity);
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(pauline->lc,to);
......@@ -103,8 +103,8 @@ static void text_message_with_privacy(void) {
static void text_message_compatibility_mode(void) {
char route[256];
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneProxyConfig* proxy;
LinphoneAddress* proxy_address;
char*tmp;
......@@ -141,8 +141,8 @@ static void text_message_compatibility_mode(void) {
}
static void text_message_with_ack(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
char* to = linphone_address_as_string(marie->identity);
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(pauline->lc,to);
LinphoneChatMessage* message = linphone_chat_room_create_message(chat_room,"Bli bli bli \n blu");
......@@ -155,8 +155,8 @@ static void text_message_with_ack(void) {
}
static void text_message_with_external_body(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
char* to = linphone_address_as_string(marie->identity);
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(pauline->lc,to);
LinphoneChatMessage* message = linphone_chat_room_create_message(chat_room,"Bli bli bli \n blu");
......@@ -172,8 +172,8 @@ static void text_message_with_external_body(void) {
}
static void text_message_with_send_error(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
char* to = linphone_address_as_string(pauline->identity);
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(marie->lc,to);
LinphoneChatMessage* message = linphone_chat_room_create_message(chat_room,"Bli bli bli \n blu");
......@@ -216,8 +216,8 @@ void info_message_received(LinphoneCore *lc, LinphoneCall* call, const LinphoneI
static void info_message_with_args(bool_t with_content) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneInfoMessage *info;
CU_ASSERT_TRUE(call(pauline,marie));
......
......@@ -23,7 +23,7 @@
#include "liblinphone_tester.h"
static LinphoneCoreManager* presence_linphone_core_manager_new(char* username) {
LinphoneCoreManager* mgr= linphone_core_manager_new2(liblinphone_tester_file_prefix, "empty_rc", FALSE);
LinphoneCoreManager* mgr= linphone_core_manager_new2( "empty_rc", FALSE);
char* identity_char;
mgr->identity= linphone_core_get_primary_contact_parsed(mgr->lc);
linphone_address_set_username(mgr->identity,username);
......@@ -68,7 +68,7 @@ void notify_presence_received(LinphoneCore *lc, LinphoneFriend * lf) {
}
static void simple_publish(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneProxyConfig* proxy;
int i=0;
linphone_core_get_default_proxy(marie->lc,&proxy);
......@@ -124,7 +124,7 @@ static void simple_subscribe(void) {
}
static void unsubscribe_while_subscribing(void) {
LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneFriend* friend = linphone_friend_new_with_addr("sip:toto@git.linphone.org"); /*any unexisting address*/
linphone_friend_edit(friend);
linphone_friend_enable_subscribes(friend,TRUE);
......
......@@ -23,7 +23,7 @@
#include "liblinphone_tester.h"
static LinphoneCoreManager* create_lcm_with_auth(unsigned int with_auth) {
LinphoneCoreManager* mgr=linphone_core_manager_new(NULL,NULL);
LinphoneCoreManager* mgr=linphone_core_manager_new(NULL);
if (with_auth) {
mgr->lc->vtable.auth_info_requested=auth_info_requested;
......@@ -238,7 +238,7 @@ static void authenticated_register_with_no_initial_credentials(){
sprintf(route,"sip:%s",test_route);
mgr = linphone_core_manager_new(NULL,NULL);
mgr = linphone_core_manager_new(NULL);
counters= get_stats(mgr->lc);
counters->number_of_auth_info_requested=0;
......@@ -264,7 +264,7 @@ static void authenticated_register_with_late_credentials(){
sprintf(route,"sip:%s",test_route);
mgr = linphone_core_manager_new(NULL,NULL);
mgr = linphone_core_manager_new(NULL);
mgr->lc->vtable.auth_info_requested=auth_info_requested2;
counters = get_stats(mgr->lc);
register_with_refresh_base_2(mgr->lc,FALSE,auth_domain,route,TRUE,transport);
......@@ -281,7 +281,7 @@ static void authenticated_register_with_wrong_credentials(){
sprintf(route,"sip:%s",test_route);
mgr=linphone_core_manager_new(NULL,NULL);
mgr=linphone_core_manager_new(NULL);
mgr->lc->vtable.auth_info_requested=auth_info_requested2;
linphone_core_add_auth_info(mgr->lc,info); /*add wrong authentication info to LinphoneCore*/
......@@ -292,7 +292,7 @@ static void authenticated_register_with_wrong_credentials(){
}
static LinphoneCoreManager* configure_lcm(void) {
LinphoneCoreManager *mgr=linphone_core_manager_new( liblinphone_tester_file_prefix, "multi_account_lrc");
LinphoneCoreManager *mgr=linphone_core_manager_new( "multi_account_lrc");
stats *counters=&mgr->stat;
CU_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&counters->number_of_LinphoneRegistrationOk,ms_list_size(linphone_core_get_proxy_config_list(mgr->lc))));
return mgr;
......@@ -424,7 +424,7 @@ static void tls_certificate_failure(){
LinphoneCore *lc;
char rootcapath[256];
mgr=linphone_core_manager_new2(liblinphone_tester_file_prefix, "pauline_rc",FALSE);
mgr=linphone_core_manager_new2("pauline_rc",FALSE);
lc=mgr->lc;
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/agent.pem", liblinphone_tester_file_prefix); /*bad root ca*/
linphone_core_set_root_ca(mgr->lc,rootcapath);
......@@ -448,7 +448,7 @@ static void tls_with_non_tls_server(){
char tmp[256];
LinphoneCore *lc;
mgr=linphone_core_manager_new2(liblinphone_tester_file_prefix, "marie_rc", 0);
mgr=linphone_core_manager_new2( "marie_rc", 0);
lc=mgr->lc;
linphone_core_get_default_proxy(lc,&proxy_cfg);
linphone_proxy_config_edit(proxy_cfg);
......
......@@ -25,7 +25,7 @@
static void upnp_start_n_stop(void) {
int tmp = 0;
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2(liblinphone_tester_file_prefix, "upnp_rc", FALSE);
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2( "upnp_rc", FALSE);
wait_for(lc_upnp->lc,lc_upnp->lc,&tmp,1);
#ifdef BUILD_UPNP
CU_ASSERT_TRUE(lc_upnp->lc->upnp != NULL);
......@@ -35,7 +35,7 @@ static void upnp_start_n_stop(void) {
static void upnp_check_state(void) {
int tmp = 0;
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2(liblinphone_tester_file_prefix, "upnp_rc", FALSE);
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2( "upnp_rc", FALSE);
wait_for(lc_upnp->lc,lc_upnp->lc,&tmp,1);
CU_ASSERT_TRUE(linphone_core_get_upnp_state(lc_upnp->lc) == LinphoneUpnpStateOk);
linphone_core_manager_destroy(lc_upnp);
......@@ -43,7 +43,7 @@ static void upnp_check_state(void) {
static void upnp_check_ipaddress(void) {
int tmp = 0;
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2(liblinphone_tester_file_prefix, "upnp_rc", FALSE);
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2( "upnp_rc", FALSE);
wait_for(lc_upnp->lc,lc_upnp->lc,&tmp,1);
const char *addr = linphone_core_get_upnp_external_ipaddress(lc_upnp->lc);
CU_ASSERT_TRUE(addr != NULL && strlen(addr)>=7);
......
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