Commit 038bebdc authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI
Browse files

Add a writable prefix variable for the tester. This will allow mobile unit...

Add a writable prefix variable for the tester. This will allow mobile unit tests to pass the message storage tests
parent a29a93cd
......@@ -46,6 +46,7 @@ extern "C" {
extern const char *liblinphone_tester_file_prefix;
extern const char *liblinphone_tester_writable_dir_prefix;
extern test_suite_t setup_test_suite;
extern test_suite_t register_test_suite;
extern test_suite_t call_test_suite;
......@@ -68,6 +69,7 @@ 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);
#ifdef __cplusplus
......@@ -453,7 +453,7 @@ static void message_storage_migration() {
char src_db[256];
char tmp_db[256];
snprintf(src_db,sizeof(src_db), "%s/messages.db", liblinphone_tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", liblinphone_tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", liblinphone_tester_writable_dir_prefix);
CU_ASSERT_EQUAL_FATAL(message_tester_copy_file(src_db, tmp_db), 1);
......@@ -49,6 +49,9 @@ const char *liblinphone_tester_file_prefix="./app/native/assets/";
const char *liblinphone_tester_file_prefix=".";
/* TODO: have the same "static" for QNX and windows as above? */
const char *liblinphone_tester_writable_dir_prefix = ".";
const char *userhostsfile = "tester_hosts";
void liblinphone_tester_clock_start(MSTimeSpec *start){
......@@ -326,6 +329,10 @@ void liblinphone_tester_set_fileprefix(const char* file_prefix){
liblinphone_tester_file_prefix = file_prefix;
void liblinphone_tester_set_writable_dir_prefix(const char* writable_dir_prefix){
liblinphone_tester_writable_dir_prefix = writable_dir_prefix;
void liblinphone_tester_init(void) {
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