Tester: continuing

parent d3d0573d
......@@ -30,7 +30,7 @@ AC_SUBST(LINPHONE_VERSION)
AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A full featured audio/video sip phone.])
AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
AM_INIT_AUTOMAKE([1.9 tar-pax])
AM_INIT_AUTOMAKE([1.9 tar-pax subdir-objects])
AC_SUBST([LIBTOOL_DEPS])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_SUBST([docdir], [${datadir}/doc])
......
mediastreamer2 @ 42916174
Subproject commit 2be165a129a174a6b9a51574aee85f90d4f38084
Subproject commit 42916174111a5db519f60d6b37ec115fef8d0436
oRTP @ 72522333
Subproject commit 3b0892f87fecbd7d3e2b34b381527ab1d7e59a59
Subproject commit 72522333e7298cb2432dfa6316097a5d19698de8
......@@ -10,7 +10,7 @@ liblinphone_HEADERS = liblinphone_tester.h
lib_LTLIBRARIES = liblinphonetester.la
liblinphonetester_la_SOURCES = tester.c \
liblinphonetester_la_SOURCES = \
accountmanager.c \
call_tester.c \
dtmf_tester.c \
......@@ -28,16 +28,17 @@ liblinphonetester_la_SOURCES = tester.c \
remote_provisioning_tester.c \
setup_tester.c \
stun_tester.c \
tester_utils.c \
transport_tester.c \
tester.c \
upnp_tester.c \
video_tester.c
video_tester.c \
common/bc_tester_utils.c common/bc_tester_utils.h
liblinphonetester_la_LDFLAGS= -no-undefined
liblinphonetester_la_LIBADD= ../coreapi/liblinphone.la $(CUNIT_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi
AM_CFLAGS = $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS)
AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS)
if BUILD_GTK_UI
......
......@@ -123,7 +123,7 @@ void account_create_on_server(Account *account, const LinphoneProxyConfig *refcf
vtable.registration_state_changed=account_created_on_server_cb;
vtable.auth_info_requested=account_created_auth_requested_cb;
lc=configure_lc_from(&vtable,tester_file_prefix,NULL,account);
lc=configure_lc_from(&vtable,bc_tester_read_dir_prefix,NULL,account);
tr.udp_port=LC_SIP_TRANSPORT_RANDOM;
tr.tcp_port=LC_SIP_TRANSPORT_RANDOM;
tr.tls_port=LC_SIP_TRANSPORT_RANDOM;
......
......@@ -1616,8 +1616,8 @@ static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* ma
}
if (mode==LinphoneMediaEncryptionDTLS) { /* for DTLS we must access certificates or at least have a directory to store them */
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", tester_file_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", tester_file_prefix);
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", bc_tester_read_dir_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", bc_tester_read_dir_prefix);
}
linphone_core_set_media_encryption(marie->lc,mode);
......@@ -2055,12 +2055,12 @@ static void call_with_file_player(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphonePlayer *player;
char hellopath[256];
char *recordpath = create_filepath(tester_writable_dir_prefix, "record", "wav");
char *recordpath = create_filepath(bc_tester_writable_dir_prefix, "record", "wav");
/*make sure the record file doesn't already exists, otherwise this test will append new samples to it*/
unlink(recordpath);
snprintf(hellopath,sizeof(hellopath), "%s/sounds/hello8000.wav", tester_file_prefix);
snprintf(hellopath,sizeof(hellopath), "%s/sounds/hello8000.wav", bc_tester_read_dir_prefix);
/*caller uses files instead of soundcard in order to avoid mixing soundcard input with file played using call's player*/
linphone_core_use_files(marie->lc,TRUE);
......@@ -2133,12 +2133,12 @@ static void call_with_mkv_file_player(void) {
ms_warning("Test skipped, no mkv support.");
goto end;
}
recordpath = create_filepath(tester_writable_dir_prefix, "record", "wav");
recordpath = create_filepath(bc_tester_writable_dir_prefix, "record", "wav");
/*make sure the record file doesn't already exists, otherwise this test will append new samples to it*/
unlink(recordpath);
snprintf(hellowav,sizeof(hellowav), "%s/sounds/hello8000_mkv_ref.wav", tester_file_prefix);
snprintf(hellomkv,sizeof(hellomkv), "%s/sounds/hello8000.mkv", tester_file_prefix);
snprintf(hellowav,sizeof(hellowav), "%s/sounds/hello8000_mkv_ref.wav", bc_tester_read_dir_prefix);
snprintf(hellomkv,sizeof(hellomkv), "%s/sounds/hello8000.mkv", bc_tester_read_dir_prefix);
/*caller uses files instead of soundcard in order to avoid mixing soundcard input with file played using call's player*/
linphone_core_use_files(marie->lc,TRUE);
......@@ -2216,8 +2216,8 @@ void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_r
linphone_core_set_media_encryption(marie->lc,mode);
linphone_core_set_media_encryption(pauline->lc,mode);
if (mode==LinphoneMediaEncryptionDTLS) { /* for DTLS we must access certificates or at least have a directory to store them */
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", tester_file_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", tester_file_prefix);
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", bc_tester_read_dir_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", bc_tester_read_dir_prefix);
}
linphone_core_set_firewall_policy(marie->lc,policy);
......@@ -2849,7 +2849,7 @@ static void record_call(const char *filename, bool_t enableVideo) {
formats = linphone_core_get_supported_file_formats(marie->lc);
for(i=0, format = formats[0]; format != NULL; i++, format = formats[i]) {
filepath = create_filepath(tester_writable_dir_prefix, filename, format);
filepath = create_filepath(bc_tester_writable_dir_prefix, filename, format);
remove(filepath);
linphone_call_params_set_record_file(marieParams, filepath);
CU_ASSERT_TRUE(call_succeeded = call_with_params(marie, pauline, marieParams, paulineParams));
......@@ -2887,7 +2887,7 @@ static void video_call_snapshot(void) {
LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc);
LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc);
LinphoneCall *callInst = NULL;
char *filename = create_filepath(tester_writable_dir_prefix, "snapshot", "jpeg");
char *filename = create_filepath(bc_tester_writable_dir_prefix, "snapshot", "jpeg");
int dummy = 0;
bool_t call_succeeded = FALSE;
......@@ -3331,8 +3331,8 @@ static void call_with_generic_cn(void) {
LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
LinphoneCall *pauline_call;
char *audio_file_with_silence=ms_strdup_printf("%s/%s",tester_file_prefix,"sounds/ahbahouaismaisbon.wav");
char *recorded_file=ms_strdup_printf("%s/%s",tester_writable_dir_prefix,"result.wav");
char *audio_file_with_silence=ms_strdup_printf("%s/%s",bc_tester_read_dir_prefix,"sounds/ahbahouaismaisbon.wav");
char *recorded_file=ms_strdup_printf("%s/%s",bc_tester_writable_dir_prefix,"result.wav");
belle_sip_object_enable_leak_detector(TRUE);
begin=belle_sip_object_get_object_count();
......
......@@ -22,6 +22,9 @@
#include "CUnit/Basic.h"
extern const char *bc_tester_read_dir_prefix;
extern const char *bc_tester_writable_dir_prefix;
typedef void (*test_function_t)(void);
typedef int (*test_suite_function_t)(const char *name);
......@@ -42,8 +45,6 @@ typedef struct {
extern "C" {
#endif
extern const char *tester_file_prefix;
extern const char *tester_writable_dir_prefix;
#define CHECK_ARG(argument, index, argc) \
if(index >= argc) { \
......@@ -51,24 +52,13 @@ fprintf(stderr, "Missing argument for \"%s\"\n", argument); \
return -1; \
} \
int tester_parse_args(int argc, char** argv, int argid, const char * additionnal_helper);
int tester_start();
int tester_test_suite_index(const char *suite_name);
void tester_list_suites();
void tester_list_suite_tests(const char *suite_name);
int tester_test_index(const char *suite_name, const char *test_name);
int tester_nb_test_suites(void);
int tester_nb_tests(const char *suite_name);
const char * tester_test_suite_name(int suite_index);
const char * tester_test_name(const char *suite_name, int test_index);
int tester_run_tests(const char *suite_name, const char *test_name);
void tester_add_suite(test_suite_t *suite);
int tester_run_suite(test_suite_t *suite);
void tester_uninit();
void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list args)
, int verbosity_info, int verbosity_error);
void bc_tester_helper(const char *name, const char* additionnal_helper);
int bc_tester_parse_args(int argc, char** argv, int argid);
int bc_tester_start();
void bc_tester_add_suite(test_suite_t *suite);
void bc_tester_uninit();
#ifdef __cplusplus
......
This diff is collapsed.
......@@ -28,6 +28,10 @@
#include <gtk/gtk.h>
#endif
static FILE * log_file = NULL;
static OrtpLogFunc ortp_log_handler;
#ifdef ANDROID
#include <android/log.h>
......@@ -41,7 +45,7 @@ static const char* LogDomain = "liblinphone_tester";
int main(int argc, char** argv);
void linphone_android_log_handler(int prio, const char *fmt, va_list args) {
void liblinphone_android_log_handler(int prio, const char *fmt, va_list args) {
char str[4096];
char *current;
char *next;
......@@ -61,17 +65,17 @@ void linphone_android_log_handler(int prio, const char *fmt, va_list args) {
}
}
static void linphone_android_ortp_log_handler(OrtpLogLevel lev, const char *fmt, va_list args) {
static void liblinphone_android_ortp_log_handler(OrtpLogLevel lev, const char *fmt, va_list args) {
int prio;
switch(lev){
case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; break;
case ORTP_MESSAGE: prio = ANDROID_LOG_INFO; break;
case ORTP_WARNING: prio = ANDROID_LOG_WARN; break;
case ORTP_ERROR: prio = ANDROID_LOG_ERROR; break;
case ORTP_FATAL: prio = ANDROID_LOG_FATAL; break;
default: prio = ANDROID_LOG_DEFAULT; break;
case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; break;
case ORTP_MESSAGE: prio = ANDROID_LOG_INFO; break;
case ORTP_WARNING: prio = ANDROID_LOG_WARN; break;
case ORTP_ERROR: prio = ANDROID_LOG_ERROR; break;
case ORTP_FATAL: prio = ANDROID_LOG_FATAL; break;
default: prio = ANDROID_LOG_DEFAULT; break;
}
linphone_android_log_handler(prio, fmt, args);
liblinphone_android_log_handler(prio, fmt, args);
}
void cunit_android_trace_handler(int level, const char *fmt, va_list args) {
......@@ -119,7 +123,6 @@ JNIEXPORT void JNICALL Java_org_linphone_tester_Tester_keepAccounts(JNIEnv *env,
JNIEXPORT void JNICALL Java_org_linphone_tester_Tester_clearAccounts(JNIEnv *env, jclass c) {
liblinphone_tester_clear_accounts();
}
#endif /* ANDROID */
#ifdef __QNX__
......@@ -128,17 +131,72 @@ static void liblinphone_tester_qnx_log_handler(OrtpLogLevel lev, const char *fmt
}
#endif /* __QNX__ */
static void log_handler(int lev, const char *fmt, va_list args) {
ortp_set_log_file(stderr);
ortp_log_handler(lev, fmt, args);
if (log_file){
ortp_set_log_file(log_file);
ortp_log_handler(lev, fmt, args);
}
}
void liblinphone_tester_init(void) {
ortp_log_handler = ortp_get_log_handler();
#if defined(ANDROID)
linphone_core_set_log_handler(liblinphone_android_ortp_log_handler);
#elif defined(__QNX__)
linphone_core_set_log_handler(liblinphone_tester_qnx_log_handler);
#else
linphone_core_set_log_handler(ortp_logv_out);
#endif
bc_tester_init(log_handler, ORTP_MESSAGE, ORTP_ERROR);
bc_tester_add_suite(&setup_test_suite);
bc_tester_add_suite(&register_test_suite);
bc_tester_add_suite(&offeranswer_test_suite);
bc_tester_add_suite(&call_test_suite);
bc_tester_add_suite(&multi_call_test_suite);
bc_tester_add_suite(&message_test_suite);
bc_tester_add_suite(&presence_test_suite);
#ifdef UPNP
bc_tester_add_suite(&upnp_test_suite);
#endif
bc_tester_add_suite(&stun_test_suite);
bc_tester_add_suite(&event_test_suite);
bc_tester_add_suite(&flexisip_test_suite);
bc_tester_add_suite(&remote_provisioning_test_suite);
bc_tester_add_suite(&quality_reporting_test_suite);
bc_tester_add_suite(&log_collection_test_suite);
bc_tester_add_suite(&transport_test_suite);
bc_tester_add_suite(&player_test_suite);
bc_tester_add_suite(&dtmf_test_suite);
#if defined(VIDEO_ENABLED) && defined(HAVE_GTK)
bc_tester_add_suite(&video_test_suite);
#endif
bc_tester_add_suite(&multicast_call_test_suite);
}
void liblinphone_tester_uninit(void) {
bc_tester_uninit();
}
static const char* liblinphone_helper =
"\t\t\t--config <config path>\n"
"\t\t\t--domain <test sip domain>\n"
"\t\t\t--auth-domain <test auth domain>\n"
"\t\t\t--dns-hosts </etc/hosts -like file to used to override DNS names (default: tester_hosts)>\n";
"\t\t\t--verbose\n"
"\t\t\t--silent\n"
"\t\t\t--log-file <output log file path>\n"
"\t\t\t--config <config path>\n"
"\t\t\t--domain <test sip domain>\n"
"\t\t\t--auth-domain <test auth domain>\n"
"\t\t\t--dns-hosts </etc/hosts -like file to used to override DNS names (default: tester_hosts)>\n";
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
int main (int argc, char *argv[])
{
int i;
int ret;
#ifdef HAVE_GTK
gtk_init(&argc, &argv);
#if !GLIB_CHECK_VERSION(2,32,0) // backward compatibility with Debian 6 and CentOS 6
......@@ -147,17 +205,22 @@ int main (int argc, char *argv[])
gdk_threads_init();
#endif
#if defined(ANDROID)
linphone_core_set_log_handler(linphone_android_ortp_log_handler);
#elif defined(__QNX__)
linphone_core_set_log_handler(liblinphone_tester_qnx_log_handler);
#else
linphone_core_set_log_file(NULL);
#endif
liblinphone_tester_init();
for(i=1;i<argc;++i){
for(i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--verbose") == 0) {
ortp_set_log_level_mask(ORTP_MESSAGE);
} else if (strcmp(argv[i], "--silent") == 0) {
ortp_set_log_level_mask(ORTP_FATAL);
} else if (strcmp(argv[i],"--log-file")==0){
CHECK_ARG("--log-file", ++i, argc);
log_file=fopen(argv[i],"w");
if (!log_file) {
ms_error("Cannot open file [%s] for writing logs because [%s]",argv[i],strerror(errno));
return -2;
} else {
ms_message("Redirecting traces to file [%s]",argv[i]);
}
} else if (strcmp(argv[i],"--domain")==0){
CHECK_ARG("--domain", ++i, argc);
test_domain=argv[i];
......@@ -166,15 +229,24 @@ int main (int argc, char *argv[])
auth_domain=argv[i];
} else if (strcmp(argv[i],"--config")==0){
CHECK_ARG("--config", ++i, argc);
tester_file_prefix=argv[i];
bc_tester_read_dir_prefix=argv[i];
}else if (strcmp(argv[i],"--dns-hosts")==0){
CHECK_ARG("--dns-hosts", ++i, argc);
userhostsfile=argv[i];
}else {
int ret = tester_parse_args(argc, argv, i, liblinphone_helper);
if (ret>0) i += ret;
else return ret;
} else {
int ret = bc_tester_parse_args(argc, argv, i);
if (ret>1) {
i += ret - 1;
continue;
} else if (ret<0) {
bc_tester_helper(argv[0], liblinphone_helper);
}
return ret;
}
}
ret = bc_tester_start();
liblinphone_tester_uninit();
return ret;
}
#endif
......@@ -22,7 +22,7 @@
#include "tester_utils.h"
#include "common/bc_tester_utils.h"
#include "linphonecore.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -53,26 +53,8 @@ extern test_suite_t multicast_call_test_suite;
extern test_suite_t multi_call_test_suite;
extern int liblinphone_tester_nb_test_suites(void);
extern int liblinphone_tester_nb_tests(const char *suite_name);
extern const char * liblinphone_tester_test_suite_name(int suite_index);
extern int liblinphone_tester_test_suite_index(const char *suite_name);
extern void liblinphone_tester_list_suites();
extern void liblinphone_tester_list_suite_tests(const char *suite_name);
extern const char * liblinphone_tester_test_name(const char *suite_name, int test_index);
extern int liblinphone_tester_test_index(const char *suite_name, const char *test_name);
extern void liblinphone_tester_init(void);
extern void liblinphone_tester_uninit(void);
extern int liblinphone_tester_run_tests(const char *suite_name, const char *test_name);
extern void liblinphone_tester_set_fileprefix(const char* file_prefix);
extern void liblinphone_tester_set_writable_dir_prefix(const char* writable_dir_prefix);
extern int liblinphone_tester_ipv6_available(void);
extern void liblinphone_tester_enable_xml( bool_t enable );
extern void liblinphone_tester_set_xml_output(const char *xml_path );
extern const char* liblinphone_tester_get_xml_output(void);
/**
* @brief Tells the tester whether or not to clean the accounts it has created between runs.
* @details Setting this to 1 will not clear the list of created accounts between successive
......@@ -306,10 +288,6 @@ void linphone_core_manager_check_accounts(LinphoneCoreManager *m);
void account_manager_destroy(void);
LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data);
void liblinphone_tester_enable_ipv6(bool_t enabled);
#ifdef ANDROID
void cunit_android_trace_handler(int level, const char *fmt, va_list args) ;
#endif
int liblinphone_tester_fprintf(FILE * stream, const char * format, ...);
void linphone_call_cb(LinphoneCall *call,void * user_data);
void call_paused_resumed_base(bool_t multicast);
void simple_call_base(bool_t enable_multicast_recv_side);
......
......@@ -94,7 +94,7 @@ static size_t getline(char **lineptr, size_t *n, FILE *stream) {
static LinphoneLogCollectionState old_collection_state;
static void collect_init() {
old_collection_state = linphone_core_log_collection_enabled();
linphone_core_set_log_collection_path(tester_writable_dir_prefix);
linphone_core_set_log_collection_path(bc_tester_writable_dir_prefix);
}
static void collect_cleanup(LinphoneCoreManager *marie) {
......@@ -171,7 +171,7 @@ static time_t check_file(LinphoneCoreManager* mgr) {
CU_ASSERT_PTR_NOT_NULL(file);
if (!file) return 0;
// 1) expect to find folder name in filename path
CU_ASSERT_PTR_NOT_NULL(strstr(filepath, tester_writable_dir_prefix));
CU_ASSERT_PTR_NOT_NULL(strstr(filepath, bc_tester_writable_dir_prefix));
// 2) check file contents
while (getline(&line, &line_size, file) != -1) {
......
......@@ -68,7 +68,7 @@ void file_transfer_received(LinphoneChatMessage *message, const LinphoneContent*
char receive_file[256];
LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(message);
LinphoneCore *lc = linphone_chat_room_get_core(cr);
snprintf(receive_file,sizeof(receive_file), "%s/receive_file.dump", tester_writable_dir_prefix);
snprintf(receive_file,sizeof(receive_file), "%s/receive_file.dump", bc_tester_writable_dir_prefix);
if (!linphone_chat_message_get_user_data(message)) {
/*first chunk, creating file*/
file = fopen(receive_file,"wb");
......@@ -462,8 +462,8 @@ static void file_transfer_message(void) {
LinphoneContent* content;
FILE *file_to_send = NULL;
size_t file_size;
char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", tester_file_prefix);
char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", tester_writable_dir_prefix);
char *send_filepath = ms_strdup_printf("%s/images/nowebcamCIF.jpg", bc_tester_read_dir_prefix);
char *receive_filepath = ms_strdup_printf("%s/receive_file.dump", bc_tester_writable_dir_prefix);
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
......@@ -611,7 +611,7 @@ static void lime_file_transfer_message(void) {
/* make sure lime is enabled */
linphone_core_set_lime(marie->lc, 1);
linphone_core_set_lime(pauline->lc, 1);
/* set the zid caches files : create two ZID cache from this valid one inserting the auto-generated sip URI for the peer account as keys in ZID cache are indexed by peer sip uri */
ZIDCacheMarieFD = fopen("tmpZIDCacheMarie.xml", "w");
ZIDCachePaulineFD = fopen("tmpZIDCachePauline.xml", "w");
......@@ -1174,7 +1174,7 @@ static void lime_unit(void) {
/* parse it to an xmlDoc */
cacheBufferAlice = xmlParseDoc(cacheBufferString);
ms_free(cacheBufferString);
/* Load Bob cache file */
CACHE = fopen("ZIDCacheBob.xml", "rb+");
cacheBufferString = (uint8_t *)ms_load_file_content(CACHE, &size);
......@@ -1391,8 +1391,8 @@ static void message_storage_migration() {
char src_db[256];
char tmp_db[256];
MSList* chatrooms;
snprintf(src_db,sizeof(src_db), "%s/messages.db", tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", tester_writable_dir_prefix);
snprintf(src_db,sizeof(src_db), "%s/messages.db", bc_tester_read_dir_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", bc_tester_writable_dir_prefix);
CU_ASSERT_EQUAL_FATAL(message_tester_copy_file(src_db, tmp_db), 0);
......@@ -1431,8 +1431,8 @@ static void history_range_full_test(){
LinphoneChatRoom *chatroom;
char src_db[256];
char tmp_db[256];
snprintf(src_db,sizeof(src_db), "%s/messages.db", tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", tester_writable_dir_prefix);
snprintf(src_db,sizeof(src_db), "%s/messages.db", bc_tester_read_dir_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", bc_tester_writable_dir_prefix);
CU_ASSERT_EQUAL_FATAL(message_tester_copy_file(src_db, tmp_db), 0);
......@@ -1473,8 +1473,8 @@ static void history_messages_count() {
MSList *messages;
char src_db[256];
char tmp_db[256];
snprintf(src_db,sizeof(src_db), "%s/messages.db", tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", tester_writable_dir_prefix);
snprintf(src_db,sizeof(src_db), "%s/messages.db", bc_tester_read_dir_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", bc_tester_writable_dir_prefix);
CU_ASSERT_EQUAL_FATAL(message_tester_copy_file(src_db, tmp_db), 0);
......
......@@ -71,7 +71,7 @@ static void play_file(const char *filename, bool_t unsupported_format, const cha
}
static void playing_test(void) {
char *filename = ms_strdup_printf("%s/sounds/hello_opus_h264.mkv", tester_file_prefix);
char *filename = ms_strdup_printf("%s/sounds/hello_opus_h264.mkv", bc_tester_read_dir_prefix);
const char *audio_mime = "opus";
const char *video_mime = "h264";
play_file(filename, !linphone_local_player_matroska_supported(), audio_mime, video_mime);
......
......@@ -18,7 +18,6 @@
#include <stdio.h>
#include "CUnit/Basic.h"
#include "tester_utils.h"
#include "linphonecore.h"
#include "private.h"
#include "liblinphone_tester.h"
......@@ -751,14 +750,14 @@ static void tls_certificate_failure(){
mgr=linphone_core_manager_new2("pauline_rc",FALSE);
lc=mgr->lc;
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/agent.pem", tester_file_prefix); /*bad root ca*/
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/agent.pem", bc_tester_read_dir_prefix); /*bad root ca*/
linphone_core_set_root_ca(mgr->lc,rootcapath);
linphone_core_set_network_reachable(lc,TRUE);
CU_ASSERT_TRUE(wait_for(mgr->lc,mgr->lc,&mgr->stat.number_of_LinphoneRegistrationFailed,1));
linphone_core_set_root_ca(mgr->lc,NULL); /*no root ca*/
linphone_core_refresh_registers(mgr->lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationFailed,2));
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", tester_file_prefix); /*goot root ca*/
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix); /*goot root ca*/
linphone_core_set_root_ca(mgr->lc,rootcapath);
linphone_core_refresh_registers(mgr->lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,1));
......@@ -796,7 +795,7 @@ static void tls_alt_name_register(){
mgr=linphone_core_manager_new2("pauline_alt_rc",FALSE);
lc=mgr->lc;
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", tester_file_prefix);
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix);
linphone_core_set_root_ca(mgr->lc,rootcapath);
linphone_core_refresh_registers(mgr->lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,1));
......@@ -811,7 +810,7 @@ static void tls_wildcard_register(){
mgr=linphone_core_manager_new2("pauline_wild_rc",FALSE);
lc=mgr->lc;
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", tester_file_prefix);
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cn/cafile.pem", bc_tester_read_dir_prefix);
linphone_core_set_root_ca(mgr->lc,rootcapath);
linphone_core_refresh_registers(mgr->lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&mgr->stat.number_of_LinphoneRegistrationOk,2));
......
......@@ -18,7 +18,6 @@
#include <stdio.h>
#include "CUnit/Basic.h"
#include "tester_utils.h"
#include "linphonecore.h"
#include "liblinphone_tester.h"
#include "lpconfig.h"
......@@ -129,7 +128,7 @@ static void linphone_lpconfig_from_buffer_zerolen_value(){
static void linphone_lpconfig_from_file_zerolen_value(){
/* parameters that have no value should return NULL, not "". */
const char* zero_rc_file = "zero_length_params_rc";
char* rc_path = ms_strdup_printf("%s/rcfiles/%s", tester_file_prefix, zero_rc_file);
char* rc_path = ms_strdup_printf("%s/rcfiles/%s", bc_tester_read_dir_prefix, zero_rc_file);
LpConfig* conf;
/* not using lp_config_new() because it expects a readable file, and iOS (for instance)
......@@ -150,7 +149,7 @@ static void linphone_lpconfig_from_file_zerolen_value(){
static void linphone_lpconfig_from_xml_zerolen_value(){
const char* zero_xml_file = "remote_zero_length_params_rc";
char* xml_path = ms_strdup_printf("%s/rcfiles/%s", tester_file_prefix, zero_xml_file);
char* xml_path = ms_strdup_printf("%s/rcfiles/%s", bc_tester_read_dir_prefix, zero_xml_file);
LpConfig* conf;
LinphoneCoreManager* mgr = linphone_core_manager_new2("empty_rc",FALSE);
......
This diff is collapsed.
......@@ -306,7 +306,7 @@ static void two_incoming_early_media_video_calls_test(void) {
/* Configure early media audio to play ring during early-media and send remote ring back tone. */
linphone_core_set_ring_during_incoming_early_media(marie->lc, TRUE);
ringback_path = ms_strdup_printf("%s/sounds/ringback.wav", tester_file_prefix);
ringback_path = ms_strdup_printf("%s/sounds/ringback.wav", bc_tester_read_dir_prefix);
linphone_core_set_remote_ringback_tone(marie->lc, ringback_path);
ms_free(ringback_path);
......
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