Commit b133c589 authored by Benjamin REIS's avatar Benjamin REIS

fix tester build on ios

parent e127ef09
......@@ -229,7 +229,7 @@ if(ENABLE_SHARED)
set_target_properties(linphone PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.linphone
MACOSX_FRAMEWORK_INFO_PLIST Info.plist.in
MACOSX_FRAMEWORK_INFO_PLIST Info.plist.in
PUBLIC_HEADER "${LINPHONE_HEADER_FILES}"
)
endif()
......
......@@ -17,6 +17,7 @@
*/
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include <ctype.h>
static const char XMLRPC_URL[] = "https://sip2.linphone.org:446/xmlrpc.php";
......
......@@ -17,6 +17,7 @@
*/
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include "audio_bypass_wav_header.h" // This is a copy of mediastreamer2/src/audiofilters/wav_header.h
/**********************************************************************
......
......@@ -22,6 +22,7 @@
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include "mediastreamer2/msutils.h"
#include "belle-sip/sipstack.h"
......
......@@ -18,6 +18,7 @@
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include "linphone/core.h"
#include "belle-sip/belle-sip.h"
......
......@@ -22,6 +22,7 @@
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include "mediastreamer2/msutils.h"
#include "belle-sip/sipstack.h"
#include <bctoolbox/defs.h>
......@@ -223,7 +224,7 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana
}
wait_for_until(caller->lc,callee->lc,NULL,0,20); /*just to sleep while iterating*/
}while (!liblinphone_tester_clock_elapsed(&ts,max_time_to_wait));
reset_call_stats(audio_stats1, linphone_call_get_audio_stats(c1));
reset_call_stats(video_stats1, linphone_call_get_video_stats(c1));
reset_call_stats(audio_stats2, linphone_call_get_audio_stats(c2));
......@@ -262,12 +263,12 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana
}
}
if (audio_stats1) linphone_call_stats_unref(audio_stats1);
if (audio_stats2) linphone_call_stats_unref(audio_stats2);
if (video_stats1) linphone_call_stats_unref(video_stats1);
if (video_stats2) linphone_call_stats_unref(video_stats2);
linphone_call_unref(c1);
linphone_call_unref(c2);
}
......@@ -1136,20 +1137,20 @@ static void cancel_other_device_after_accept(void) {
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingProgress, 1));
call_callee = linphone_core_get_current_call(callee_mgr->lc);
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
linphone_call_ref(call_callee);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
linphone_call_ref(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(call_callee_2);
BC_ASSERT_EQUAL( linphone_call_accept(call_callee), 0 , int, "%d");
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallConnected,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
rei = linphone_call_get_error_info(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(rei);
if (rei){
......@@ -1189,12 +1190,12 @@ static void cancel_other_device_after_decline(void) {
call_callee = linphone_core_get_current_call(callee_mgr->lc);
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
linphone_call_ref(call_callee);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
linphone_call_ref(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(call_callee_2);
BC_ASSERT_EQUAL(linphone_call_decline(call_callee, LinphoneReasonDeclined), 0 , int, "%d");
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallReleased, 1));
......@@ -1202,7 +1203,7 @@ static void cancel_other_device_after_decline(void) {
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &callee_mgr->stat.number_of_LinphoneCallReleased, 1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
rei = linphone_call_get_error_info(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(rei);
if (rei){
......@@ -1324,11 +1325,11 @@ static void cancelled_ringing_call(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
const bctbx_list_t * call_history;
LinphoneCall* out_call;
char * db_path= bctbx_strdup_printf("%s,%s",bc_tester_get_writable_dir_prefix(),"tmp_call_log.db");
linphone_core_set_call_logs_database_path(marie->lc,db_path);
out_call = linphone_core_invite_address(pauline->lc,marie->identity);
linphone_call_ref(out_call);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallIncomingReceived,1));
......@@ -1338,12 +1339,12 @@ static void cancelled_ringing_call(void) {
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallReleased,1));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd,1, int, "%d");
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallEnd,1, int, "%d");
call_history = linphone_core_get_call_history(marie->lc);
BC_ASSERT_PTR_NOT_NULL(call_history);
BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i");
BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i");
linphone_call_unref(out_call);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
......@@ -1717,7 +1718,7 @@ static void on_ack_processing(LinphoneCall *call, LinphoneHeaders *ack, bool_t i
static void call_created(LinphoneCore *lc, LinphoneCall *call){
LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get());
linphone_call_cbs_set_ack_processing(cbs, on_ack_processing);
linphone_call_add_callbacks(call, cbs);
linphone_call_add_callbacks(call, cbs);
linphone_call_cbs_unref(cbs);
}
......@@ -1736,7 +1737,7 @@ static void call_with_custom_headers(void) {
char* tmp=linphone_address_as_string_uri_only(marie->identity);
char tmp2[256];
LinphoneCoreCbs *core_cbs = linphone_factory_create_core_cbs(linphone_factory_get());
snprintf(tmp2,sizeof(tmp2),"%s?uriHeader=myUriHeader",tmp);
marie_identity=linphone_address_new(tmp2);
ms_free(tmp);
......@@ -1746,7 +1747,7 @@ static void call_with_custom_headers(void) {
params=linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_add_custom_header(params,"Weather","bad");
linphone_call_params_add_custom_header(params,"Working","yes");
linphone_core_cbs_set_call_created(core_cbs, call_created);
linphone_core_add_callbacks(marie->lc, core_cbs);
linphone_core_add_callbacks(pauline->lc, core_cbs);
......@@ -1781,11 +1782,11 @@ static void call_with_custom_headers(void) {
BC_ASSERT_PTR_NOT_NULL(marie_remote_contact_header);
BC_ASSERT_STRING_EQUAL(pauline_remote_contact,pauline_remote_contact_header);
BC_ASSERT_STRING_EQUAL(marie_remote_contact,marie_remote_contact_header);
/*we need to wait for the ack to arrive*/
wait_for_until(marie->lc, pauline->lc, NULL, 0, 3000);
BC_ASSERT_TRUE(linphone_call_get_user_data(call_marie) == (void*)1);
BC_ASSERT_TRUE(linphone_call_get_user_data(call_pauline) == (void*)1);
......@@ -6228,18 +6229,18 @@ static void simple_call_with_gruu(void) {
linphone_core_manager_init(pauline, "pauline_tcp_rc", NULL);
linphone_core_add_supported_tag(pauline->lc,"gruu");
linphone_core_manager_start(pauline,TRUE);
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneRegistrationOk, 1));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneRegistrationOk, 1));
pauline_cfg = linphone_core_get_default_proxy_config(pauline->lc);
pauline_addr = linphone_proxy_config_get_contact(pauline_cfg);
BC_ASSERT_PTR_NOT_NULL(pauline_addr);
BC_ASSERT_TRUE(linphone_address_has_uri_param(pauline_addr,"gr"));
BC_ASSERT_STRING_EQUAL(linphone_address_get_domain(pauline_addr),"sip.example.org");
marie_call = linphone_core_invite_address(marie->lc, pauline_addr);
BC_ASSERT_PTR_NOT_NULL(marie_call);
if(!marie_call) goto end;
......@@ -6247,7 +6248,7 @@ static void simple_call_with_gruu(void) {
pauline_call = linphone_core_get_current_call(pauline->lc);
BC_ASSERT_PTR_NOT_NULL(pauline_call);
if(!pauline_call) goto end;
marie_addr = linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(marie->lc));
BC_ASSERT_TRUE(linphone_address_has_uri_param(marie_addr,"gr"));
BC_ASSERT_STRING_EQUAL(linphone_address_get_domain(marie_addr),"sip.example.org");
......@@ -6260,12 +6261,12 @@ static void simple_call_with_gruu(void) {
ms_free(result);
}
linphone_address_unref(contact_addr);
linphone_call_accept(pauline_call);
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1));
contact_addr = linphone_address_new(linphone_call_get_remote_contact(marie_call));
if (!BC_ASSERT_TRUE(linphone_address_equal(contact_addr, pauline_addr))) {
char* expected = linphone_address_as_string(pauline_addr);
......@@ -6275,10 +6276,10 @@ static void simple_call_with_gruu(void) {
ms_free(result);
}
linphone_address_unref(contact_addr);
liblinphone_tester_check_rtcp(marie,pauline);
end_call(marie,pauline);
//BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1));
//BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1));
......
......@@ -18,6 +18,7 @@
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#ifdef VIDEO_ENABLED
static void call_paused_resumed_with_video_base_call_cb(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message) {
......
......@@ -20,6 +20,7 @@
#include "object/clonable-object.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
......
......@@ -20,6 +20,7 @@
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "linphone/lpconfig.h"
#include "tester_utils.h"
#if HAVE_SIPP
......@@ -99,16 +100,16 @@ LinphoneAddress * linphone_core_manager_resolve(LinphoneCoreManager *mgr, const
int err;
int port = linphone_address_get_port(source);
LinphoneAddress * dest;
sal_resolve_a(linphone_core_get_sal(mgr->lc)
,linphone_address_get_domain(source)
,linphone_address_get_port(source)
,AF_INET
,dest_server_server_resolved
,&addrinfo);
dest=linphone_address_new(NULL);
wait_for(mgr->lc, mgr->lc, (int*)&addrinfo, 1);
err=bctbx_getnameinfo((struct sockaddr*)addrinfo->ai_addr,addrinfo->ai_addrlen,ipstring,INET6_ADDRSTRLEN,NULL,0,NI_NUMERICHOST);
if (err !=0 ){
......@@ -117,7 +118,7 @@ LinphoneAddress * linphone_core_manager_resolve(LinphoneCoreManager *mgr, const
linphone_address_set_domain(dest, ipstring);
if (port > 0)
linphone_address_set_port(dest, port);
return dest;
}
......
......@@ -28,6 +28,7 @@
#include "liblinphone_tester.h"
#include "linphone/core.h"
#include "private.h"
#include "tester_utils.h"
#include "tools/private-access.h"
#include "tools/tester.h"
......
......@@ -21,6 +21,7 @@
#include "content/content-manager.h"
#include "content/content-type.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
using namespace LinphonePrivate;
using namespace std;
......@@ -161,7 +162,7 @@ static const char* part4 = \
void multipart_to_list () {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
ContentManager manager(marie->lc);
Content multipartContent = Content();
multipartContent.setBody(multipart);
multipartContent.setContentType(ContentType("multipart", "related"));
......
......@@ -28,6 +28,7 @@
#include "private.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
......
......@@ -17,6 +17,7 @@
*/
#include "liblinphone_tester.h"
#include "tester_utils.h"
void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
stats* counters = get_stats(lc);
......
......@@ -22,6 +22,7 @@
#include "linphone/lpconfig.h"
#include <linphone/event.h>
#include "liblinphone_tester.h"
#include "tester_utils.h"
static const char *subscribe_content="<somexml>blabla</somexml>";
static const char *notify_content="<somexml2>blabla</somexml2>";
......@@ -342,7 +343,7 @@ static void subscribe_loosing_dialog(void) {
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,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionActive,1,5000));
......@@ -357,7 +358,7 @@ static void subscribe_loosing_dialog(void) {
linphone_core_manager_destroy(pauline);
pauline = linphone_core_manager_new( "pauline_tcp_rc");
lcs = bctbx_list_append(lcs, pauline->lc);
/* Marie will retry the subscription.
* She will first receive a 503 Service unavailable from flexisip thanks the ICMP error returned by the no longer existing Pauline.
* Then she will forge a new SUBSCRIBE in order to restart a new dialog, and this one will reach the new Pauline.*/
......@@ -367,10 +368,10 @@ static void subscribe_loosing_dialog(void) {
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionActive,1,5000));
BC_ASSERT_PTR_NOT_NULL(pauline->lev);
if (pauline->lev) BC_ASSERT_EQUAL(linphone_event_get_subscription_state(pauline->lev), LinphoneSubscriptionActive, int, "%d");
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,2,5000));
linphone_event_terminate(lev);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionTerminated,1,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionTerminated,1,5000));
......@@ -405,7 +406,7 @@ static void subscribe_with_io_error(void) {
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,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionActive,1,5000));
......@@ -414,18 +415,18 @@ static void subscribe_with_io_error(void) {
/* now marie gets network errors when refreshing*/
sal_set_send_error(linphone_core_get_sal(marie->lc), -1);
/*marie will retry the subscription*/
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionOutgoingProgress,2,8000));
sal_set_send_error(linphone_core_get_sal(marie->lc), 0);
/*and get it accepted again*/
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionActive,2,10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionActive,2,5000));
BC_ASSERT_EQUAL(linphone_event_get_subscription_state(pauline->lev), LinphoneSubscriptionActive, int, "%d");
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,2,5000));
linphone_event_terminate(lev);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionTerminated,1,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionTerminated,1,5000));
......@@ -459,7 +460,7 @@ static void subscribe_not_timely_responded(void) {
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,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneSubscriptionActive,1,5000));
......@@ -470,7 +471,7 @@ static void subscribe_not_timely_responded(void) {
lcs = bctbx_list_remove(lcs, pauline->lc);
/*marie's dialog will expire while the SUBSCRIBE refresh is in progress*/
wait_for_list(lcs, NULL, 0, 8000);
lcs = bctbx_list_append(lcs, pauline->lc);
wait_for_list(lcs, NULL, 0, 3000);
linphone_event_terminate(lev);
......@@ -503,7 +504,7 @@ static void publish_test_with_args(bool_t refresh, int expires){
linphone_event_add_custom_header(lev,"CustomHeader","someValue");
linphone_event_ref(lev);
linphone_event_send_publish(lev,content);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePublishProgress,1,1000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePublishOk,1,3000));
......@@ -557,7 +558,7 @@ static void out_of_dialog_notify(void){
linphone_event_ref(lev);
linphone_event_add_custom_header(lev,"CustomHeader","someValue");
linphone_event_notify(lev,content);
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_NotifyReceived,1,3000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionTerminated,1,3000));
......
......@@ -20,6 +20,7 @@
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
static void setPublish(LinphoneProxyConfig * proxy_config, bool_t enable) {
linphone_proxy_config_edit(proxy_config);
......@@ -1208,11 +1209,11 @@ static void redis_publish_subscribe(void) {
linphone_call_accept(linphone_core_get_current_call(marie2->lc));
BC_ASSERT_TRUE(wait_for_until(marie2->lc, pauline->lc, &marie2->stat.number_of_LinphoneCallStreamsRunning, 1, 3000));
BC_ASSERT_TRUE(wait_for_until(marie2->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1, 3000));
liblinphone_tester_check_rtcp(marie2, pauline);
linphone_call_terminate(linphone_core_get_current_call(marie2->lc));
BC_ASSERT_TRUE(wait_for_until(marie2->lc, pauline->lc, &marie2->stat.number_of_LinphoneCallEnd, 1, 3000));
BC_ASSERT_TRUE(wait_for_until(marie2->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1, 3000));
......
......@@ -19,6 +19,7 @@
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic push
......@@ -193,7 +194,7 @@ int liblinphone_tester_set_log_file(const char *filename) {
return -1;
}
ms_message("Redirecting traces to file [%s]", filename);
linphone_core_set_log_file(log_file);
linphone_core_set_log_file(log_file);
return 0;
}
......
......@@ -25,7 +25,6 @@
#include <bctoolbox/tester.h>
#include "linphone/core.h"
#include <mediastreamer2/msutils.h>
#include "tester_utils.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......
......@@ -25,6 +25,7 @@
#include <AudioToolbox/AudioToolbox.h>
#include <CoreFoundation/CFRunLoop.h>
#include "liblinphone_tester.h"
#include "tester_utils.h"
int g_argc;
char** g_argv;
......@@ -64,5 +65,4 @@ int main(int argc, char * argv[]) {
return 0;
}
#endif // target IPHONE
#include <string>
#include "liblinphone_tester_windows.h"
#include "tester_utils.h"
using namespace BelledonneCommunications::Linphone::Tester;
using namespace Platform;
......
......@@ -22,6 +22,7 @@
#include <time.h>
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#ifdef HAVE_ZLIB
#include <zlib.h>
......
......@@ -24,6 +24,7 @@
#include "private.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
......
......@@ -20,6 +20,7 @@
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include "lime.h"
#include "bctoolbox/crypto.h"
#include <belle-sip/object.h>
......@@ -2336,7 +2337,7 @@ void file_and_text_message(void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text_content(msg), "Text message");
linphone_chat_room_send_chat_message(chat_room, msg);
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1, 60000));
if (marie->stat.last_received_chat_message) {
......
......@@ -28,6 +28,7 @@
#include "private.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
......
......@@ -21,6 +21,7 @@
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
static int get_codec_position(const MSList *l, const char *mime_type, int rate){
const MSList *elem;
......@@ -446,7 +447,7 @@ static void compatible_avpf_features(void) {
bool_t call_ok;
if (configure_core_for_avpf_and_video(marie->lc) == NULL) goto end;
pt = configure_core_for_avpf_and_video(pauline->lc);
BC_ASSERT_TRUE((call_ok=call(marie, pauline)));
......@@ -470,7 +471,7 @@ static void incompatible_avpf_features(void) {
bool_t call_ok;
if (configure_core_for_avpf_and_video(marie->lc) == NULL) goto end;
pt = configure_core_for_avpf_and_video(pauline->lc);
pt->avpf.features = PAYLOAD_TYPE_AVPF_NONE;
......
......@@ -17,6 +17,7 @@
*/
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include <mediastreamer2/mediastream.h>
static bool_t wait_for_eof(bool_t *eof, int *time,int time_refresh, int timeout) {
......
This diff is collapsed.
......@@ -19,6 +19,7 @@
#include "linphone/core.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
static LinphoneCoreManager* presence_linphone_core_manager_new_with_rc_name(char* username, char * rc_name) {
LinphoneCoreManager* mgr= linphone_core_manager_new2( rc_name, FALSE);
......@@ -146,7 +147,7 @@ static void simple_publish_with_expire(int expires) {
LinphoneProxyConfig* proxy;
LinphonePresenceModel* presence;
LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_publish_state_changed(cbs, linphone_publish_state_changed);
_linphone_core_add_callbacks(marie->lc, cbs, TRUE);
linphone_core_cbs_unref(cbs);
......@@ -215,26 +216,26 @@ static void publish_with_dual_identity(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new("multi_account_rc");
const bctbx_list_t* proxies;
LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_publish_state_changed(cbs, linphone_publish_state_changed);
_linphone_core_add_callbacks(pauline->lc, cbs, TRUE);
linphone_core_cbs_unref(cbs);
for (proxies = linphone_core_get_proxy_config_list(pauline->lc); proxies!=NULL; proxies = proxies->next) {
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *) proxies->data;
linphone_proxy_config_edit(proxy);
linphone_proxy_config_enable_publish(proxy,TRUE);
linphone_proxy_config_done(proxy);
}
BC_ASSERT_TRUE(wait_for(pauline->lc,pauline->lc,&pauline->stat.number_of_LinphonePublishProgress,4));
BC_ASSERT_TRUE(wait_for(pauline->lc,pauline->lc,&pauline->stat.number_of_LinphonePublishOk,4));
linphone_core_manager_stop(pauline);
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphonePublishCleared,4,int,"%i");
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphonePublishOk,4,int,"%i");
linphone_core_manager_destroy(pauline);
}
static bool_t subscribe_to_callee_presence(LinphoneCoreManager* caller_mgr,LinphoneCoreManager* callee_mgr) {
stats initial_caller=caller_mgr->stat;
......@@ -309,30 +310,30 @@ static void publish_with_network_state_changes(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneProxyConfig* proxy;
LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_publish_state_changed(cbs, linphone_publish_state_changed);
_linphone_core_add_callbacks(marie->lc, cbs,TRUE);
linphone_core_cbs_unref(cbs);
proxy = linphone_core_get_default_proxy_config(marie->lc);
linphone_proxy_config_edit(proxy);
linphone_proxy_config_enable_publish(proxy,TRUE);
linphone_proxy_config_done(proxy);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,1));
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,1));
linphone_core_set_network_reachable(marie->lc, FALSE);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneRegistrationNone,1));
BC_ASSERT_FALSE(wait_for_until(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2,1000));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,1,int,"%i");
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishError,0,int,"%i");
linphone_core_set_network_reachable(marie->lc, TRUE);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2));
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,2));
linphone_core_manager_stop(marie);
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,1,int,"%i"); /*yes it is 3 because when we change the expires, a new LinphoneEvent is created*/
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,2,int,"%i");
......
......@@ -19,6 +19,7 @@
#include "object/property-container.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
......
......@@ -17,6 +17,7 @@
*/
#include "liblinphone_tester.h"
#include "tester_utils.h"
#include <stdlib.h>
......@@ -131,15 +132,15 @@ static void phone_normalization_with_proxy(void) {
linphone_proxy_config_set_dial_prefix(proxy, "52");
BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+5217227718184"), "+5217227718184"); /*this is a mobile phone number */
BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+528127718184"), "+528127718184"); /*this is a landline phone number from Monterrey*/
// Phone normalization for myanmar dial plans
linphone_proxy_config_set_dial_prefix(proxy, "95");
BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "9965066691"), "+959965066691");
// Phone normalization for cameroon dial plans
linphone_proxy_config_set_dial_prefix(proxy, "237");
BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "674788175"), "+237674788175");
linphone_proxy_config_unref(proxy);
}
......@@ -220,16 +221,16 @@ static void load_dynamic_proxy_config(void) {
"</config>";
BC_ASSERT_FALSE(linphone_config_load_from_xml_string(linphone_core_get_config(lauriane->lc),config));
proxy = linphone_core_create_proxy_config(lauriane->lc);