Skip to content

Commit

Permalink
LiblinphoneTester: sort suites & tests alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
bagage committed Jun 7, 2016
1 parent 0387526 commit 62b6a80
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions LiblinphoneTester/Base.lproj/Main_iPad.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="H1p-Uh-vWS">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand Down
9 changes: 6 additions & 3 deletions LiblinphoneTester/DetailTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,19 @@ - (void)configureView {
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 {
Expand Down
5 changes: 4 additions & 1 deletion LiblinphoneTester/MasterView.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,21 @@ - (void)viewDidLoad {
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);

liblinphonetester_ipv6 = true;

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 {
Expand Down
2 changes: 1 addition & 1 deletion linphone-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>
Expand Down

0 comments on commit 62b6a80

Please sign in to comment.