// // LinphoneTester_Tests.m // LinphoneTester Tests // // Created by guillaume on 10/09/2014. // // #import #include "linphone/linphonecore.h" #include "linphone/liblinphone_tester.h" #import "NSObject+DTRuntime.h" #import "Utils.h" @interface LinphoneTester_Tests : XCTestCase @property (retain, nonatomic) NSString* bundlePath; @property (retain, nonatomic) NSString* documentPath; @end @implementation LinphoneTester_Tests + (NSArray*)skippedSuites { NSArray* skipped_suites = @[@"Flexisip"]; return skipped_suites; } + (NSString*)safetyTestString:(NSString*)testString{ NSCharacterSet *charactersToRemove = [[NSCharacterSet alphanumericCharacterSet] invertedSet]; return [[testString componentsSeparatedByCharactersInSet:charactersToRemove] componentsJoinedByString:@"_"]; } + (void)initialize { static char * bundle = NULL; static char * documents = NULL; bc_tester_init((void (*)(int, const char *fm, va_list))linphone_iphone_log_handler, ORTP_MESSAGE, ORTP_ERROR); 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]); LOGI(@"Bundle path: %@", bundlePath); LOGI(@"Document path: %@", documentPath); bc_tester_set_resource_dir_prefix(bundle); bc_tester_set_writable_dir_prefix(documents); liblinphone_tester_keep_accounts(TRUE); int count = bc_tester_nb_suites(); for (int i=0; i