From 30b5402c6c52478859ef972aa090c2f114bd9bd7 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 1 Dec 2014 14:27:41 +0100 Subject: [PATCH] Use properties for bundle path in linphone tester + cleanup + add resource files for the tester --- LinphoneTester Tests/LinphoneTester_Tests.m | 21 +++++++++------------ LinphoneTester/MasterViewController.m | 16 ---------------- linphone.xcodeproj/project.pbxproj | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/LinphoneTester Tests/LinphoneTester_Tests.m b/LinphoneTester Tests/LinphoneTester_Tests.m index d69ca54c2..3b783aa9f 100644 --- a/LinphoneTester Tests/LinphoneTester_Tests.m +++ b/LinphoneTester Tests/LinphoneTester_Tests.m @@ -12,14 +12,11 @@ #import "NSObject+DTRuntime.h" @interface LinphoneTester_Tests : XCTestCase - +@property (retain, nonatomic) NSString* bundlePath; +@property (retain, nonatomic) NSString* documentPath; @end -@implementation LinphoneTester_Tests { - NSString* bundlePath; - NSString* documentPath; -} - +@implementation LinphoneTester_Tests static void linphone_log_function(OrtpLogLevel lev, const char *fmt, va_list args) { NSString* log = [[NSString alloc] initWithFormat:[NSString stringWithUTF8String:fmt] arguments:args]; @@ -40,14 +37,14 @@ void LSLog(NSString* fmt, ...){ - (id)init { self = [super init]; if( self ){ - bundlePath = [[NSBundle mainBundle] bundlePath]; + self.bundlePath = [[NSBundle mainBundle] bundlePath]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - documentPath = [paths objectAtIndex:0]; - LSLog(@"Bundle path: %@", bundlePath); - LSLog(@"Document path: %@", documentPath); + self.documentPath = [paths objectAtIndex:0]; + LSLog(@"Bundle path: %@", self.bundlePath); + LSLog(@"Document path: %@", self.documentPath); - liblinphone_tester_set_fileprefix([bundlePath UTF8String]); - liblinphone_tester_set_writable_dir_prefix( ms_strdup([documentPath UTF8String]) ); + liblinphone_tester_set_fileprefix([self.bundlePath UTF8String]); + liblinphone_tester_set_writable_dir_prefix( [self.documentPath UTF8String] ); } return self; } diff --git a/LinphoneTester/MasterViewController.m b/LinphoneTester/MasterViewController.m index 665d89832..16d6686d0 100644 --- a/LinphoneTester/MasterViewController.m +++ b/LinphoneTester/MasterViewController.m @@ -46,22 +46,6 @@ void LSLog(NSString* fmt, ...){ static void linphone_log_function(OrtpLogLevel lev, const char *fmt, va_list args) { NSString* log = [[NSString alloc] initWithFormat:[NSString stringWithUTF8String:fmt] arguments:args]; NSLog(@"%@",log); - -// [logsBuffer addObject:log]; -// -// if (logsBuffer.count >= kLogsBufferCapacity ) { -// [lastLogs addObjectsFromArray:logsBuffer]; -// -// if( lastLogs.count >= kLastLogsCapacity - kLogsBufferCapacity ){ -// [lastLogs removeObjectsInRange:NSMakeRange(0, kLogsBufferCapacity)]; -// } -// [[NSNotificationCenter defaultCenter] postNotificationName:kLogsUpdateNotification -// object:nil -// userInfo:@{@"newlogs": [logsBuffer copy]}]; -// [logsBuffer removeAllObjects]; -// } - - } - (void)setupLogging { diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 231db8350..1ca88aa5b 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -771,6 +771,13 @@ F0C1F9141A28781F009402C9 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = F0C1F90A1A28781F009402C9 /* logo.png */; }; F0C1F9151A28781F009402C9 /* strech-bottom.png in Resources */ = {isa = PBXBuildFile; fileRef = F0C1F90B1A28781F009402C9 /* strech-bottom.png */; }; F0C1F9161A28781F009402C9 /* strech-top.png in Resources */ = {isa = PBXBuildFile; fileRef = F0C1F90C1A28781F009402C9 /* strech-top.png */; }; + F0C1F91D1A2CA345009402C9 /* local_tester_hosts in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C40193630CA00974404 /* local_tester_hosts */; }; + F0C1F91E1A2CA352009402C9 /* marie_xml in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C41193630CA00974404 /* marie_xml */; }; + F0C1F91F1A2CA354009402C9 /* tester_hosts in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C42193630CA00974404 /* tester_hosts */; }; + F0C1F9201A2CA358009402C9 /* rcfiles in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3719362C1500974404 /* rcfiles */; }; + F0C1F9211A2CA35A009402C9 /* sounds in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3B19362C2200974404 /* sounds */; }; + F0C1F9221A2CA35C009402C9 /* images in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3A19362C2200974404 /* images */; }; + F0C1F9231A2CA35E009402C9 /* certificates in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3919362C2200974404 /* certificates */; }; F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; F84015BF1939FE37006ABAB5 /* test_failed.png in Resources */ = {isa = PBXBuildFile; fileRef = F84015BC1939FE37006ABAB5 /* test_failed.png */; }; F84015C01939FE37006ABAB5 /* test_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = F84015BD1939FE37006ABAB5 /* test_inprogress.png */; }; @@ -3675,7 +3682,14 @@ buildActionMask = 2147483647; files = ( F08F119A19C09D88007D70C2 /* flexisip in Resources */, + F0C1F91D1A2CA345009402C9 /* local_tester_hosts in Resources */, + F0C1F9211A2CA35A009402C9 /* sounds in Resources */, F08F118D19C09C6B007D70C2 /* InfoPlist.strings in Resources */, + F0C1F9231A2CA35E009402C9 /* certificates in Resources */, + F0C1F9221A2CA35C009402C9 /* images in Resources */, + F0C1F9201A2CA358009402C9 /* rcfiles in Resources */, + F0C1F91F1A2CA354009402C9 /* tester_hosts in Resources */, + F0C1F91E1A2CA352009402C9 /* marie_xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; };