From 62b6a80ba037b640ec2e4642d2dc05fe91fd30b9 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 7 Jun 2016 10:17:29 +0200 Subject: [PATCH] LiblinphoneTester: sort suites & tests alphabetically --- LiblinphoneTester/Base.lproj/Main_iPad.storyboard | 4 ++-- LiblinphoneTester/DetailTableView.m | 9 ++++++--- LiblinphoneTester/MasterView.m | 5 ++++- linphone-Info.plist | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/LiblinphoneTester/Base.lproj/Main_iPad.storyboard b/LiblinphoneTester/Base.lproj/Main_iPad.storyboard index 583e3d8f8..20e8eea8e 100644 --- a/LiblinphoneTester/Base.lproj/Main_iPad.storyboard +++ b/LiblinphoneTester/Base.lproj/Main_iPad.storyboard @@ -1,8 +1,8 @@ - + - + diff --git a/LiblinphoneTester/DetailTableView.m b/LiblinphoneTester/DetailTableView.m index e66fe9948..f86577e3e 100644 --- a/LiblinphoneTester/DetailTableView.m +++ b/LiblinphoneTester/DetailTableView.m @@ -79,16 +79,19 @@ static NSString *const kAllTestsName = @"Run All tests"; return; } - [_tests - addObject:[TestItem testWithName:kAllTestsName fromSuite:self.detailItem]]; // suite name not used for this one - if ([self.detailItem isEqualToString:@"All"]) { + // dont sort tests if we use all suites at once for (int i = 0; i < bc_tester_nb_suites(); i++) { [self addTestsFromSuite:[NSString stringWithUTF8String:bc_tester_suite_name(i)]]; } } else { [self addTestsFromSuite:self.detailItem]; + [_tests sortUsingComparator:^(TestItem *obj1, TestItem *obj2) { + return [obj1.name compare:obj2.name]; + }]; } + // suite name not used for this one + [_tests insertObject:[TestItem testWithName:kAllTestsName fromSuite:self.detailItem] atIndex:0]; } - (void)viewDidLoad { diff --git a/LiblinphoneTester/MasterView.m b/LiblinphoneTester/MasterView.m index 901848ec5..faa6fc05a 100644 --- a/LiblinphoneTester/MasterView.m +++ b/LiblinphoneTester/MasterView.m @@ -67,6 +67,8 @@ void tester_logs_handler(int level, const char *fmt, va_list args) { bc_tester_set_resource_dir_prefix([bundlePath UTF8String]); bc_tester_set_writable_dir_prefix([documentPath UTF8String]); + liblinphonetester_ipv6 = true; + LOGI(@"Bundle path: %@", bundlePath); LOGI(@"Document path: %@", documentPath); @@ -74,11 +76,12 @@ void tester_logs_handler(int level, const char *fmt, va_list args) { int count = bc_tester_nb_suites(); _objects = [[NSMutableArray alloc] initWithCapacity:count + 1]; - [_objects addObject:@"All"]; for (int i = 0; i < count; i++) { const char *suite = bc_tester_suite_name(i); [_objects addObject:[NSString stringWithUTF8String:suite]]; } + [_objects sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; + [_objects insertObject:@"All" atIndex:0]; } - (void)dealloc { diff --git a/linphone-Info.plist b/linphone-Info.plist index 92d7ad04c..1502db231 100644 --- a/linphone-Info.plist +++ b/linphone-Info.plist @@ -53,7 +53,7 @@ CFBundleVersion - 3 + 6 LSRequiresIPhoneOS UIApplicationExitsOnSuspend