mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
TestsLiblinphone: fix invalid cache directory
This commit is contained in:
parent
ac330b8d08
commit
c75458cff2
4 changed files with 17 additions and 20 deletions
|
|
@ -31,10 +31,12 @@
|
|||
NSError *error;
|
||||
// cache directory must be created if not existing
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:cachePath isDirectory:&isDir] && isDir == NO) {
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:cachePath
|
||||
withIntermediateDirectories:NO
|
||||
attributes:nil
|
||||
error:&error];
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:cachePath
|
||||
withIntermediateDirectories:NO
|
||||
attributes:nil
|
||||
error:&error]) {
|
||||
LOGE(@"Could not create cache directory: %@", error);
|
||||
}
|
||||
}
|
||||
return cachePath;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
@interface MasterView () {
|
||||
NSMutableArray *_objects;
|
||||
NSString *bundlePath;
|
||||
NSString *documentPath;
|
||||
NSString *writablePath;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
@ -58,19 +58,19 @@ void tester_logs_handler(int level, const char *fmt, va_list args) {
|
|||
liblinphone_tester_keep_accounts(TRUE);
|
||||
|
||||
bundlePath = [[NSBundle mainBundle] bundlePath];
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
documentPath = [paths objectAtIndex:0];
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
writablePath = [paths objectAtIndex:0];
|
||||
|
||||
bc_tester_init(tester_logs_handler, ORTP_MESSAGE, ORTP_ERROR, "rcfiles");
|
||||
liblinphone_tester_add_suites();
|
||||
|
||||
bc_tester_set_resource_dir_prefix([bundlePath UTF8String]);
|
||||
bc_tester_set_writable_dir_prefix([documentPath UTF8String]);
|
||||
bc_tester_set_writable_dir_prefix([writablePath UTF8String]);
|
||||
|
||||
liblinphonetester_ipv6 = true;
|
||||
|
||||
LOGI(@"Bundle path: %@", bundlePath);
|
||||
LOGI(@"Document path: %@", documentPath);
|
||||
LOGI(@"Writable path: %@", writablePath);
|
||||
|
||||
liblinphonetester_ipv6 = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,6 @@ void tester_logs_handler(int level, const char *fmt, va_list args) {
|
|||
}
|
||||
|
||||
+ (void)initialize {
|
||||
static char *bundle = NULL;
|
||||
static char *documents = NULL;
|
||||
|
||||
// turn off logs since jenkins fails to parse output otherwise. If
|
||||
// you want to debug a specific test, comment this temporary
|
||||
[Log enableLogs:ORTP_WARNING];
|
||||
|
|
@ -46,16 +43,14 @@ void tester_logs_handler(int level, const char *fmt, va_list args) {
|
|||
liblinphone_tester_add_suites();
|
||||
|
||||
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *documentPath = [paths objectAtIndex:0];
|
||||
bundle = ms_strdup([bundlePath UTF8String]);
|
||||
documents = ms_strdup([documentPath UTF8String]);
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
NSString *writablePath = [paths objectAtIndex:0];
|
||||
|
||||
LOGI(@"Bundle path: %@", bundlePath);
|
||||
LOGI(@"Document path: %@", documentPath);
|
||||
LOGI(@"Document path: %@", writablePath);
|
||||
|
||||
bc_tester_set_resource_dir_prefix(bundle);
|
||||
bc_tester_set_writable_dir_prefix(documents);
|
||||
bc_tester_set_resource_dir_prefix(bundlePath.UTF8String);
|
||||
bc_tester_set_writable_dir_prefix(writablePath.UTF8String);
|
||||
|
||||
liblinphone_tester_keep_accounts(TRUE);
|
||||
int count = bc_tester_nb_suites();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 73e1013cc153f440e4ba0e9ca7e6a26ac8c02c40
|
||||
Subproject commit dca7132fe4c07bc7fd62ebecbcd0efa576875c70
|
||||
Loading…
Add table
Reference in a new issue