mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Tester robust to test or tests suite with null name
This commit is contained in:
parent
98df3fd37a
commit
1703bfefa5
2 changed files with 18 additions and 11 deletions
|
|
@ -83,7 +83,10 @@ static NSString *const kAllTestsName = @"Run All tests";
|
|||
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)]];
|
||||
const char *suite = bc_tester_suite_name(i);
|
||||
if (suite) {
|
||||
[self addTestsFromSuite:[NSString stringWithUTF8String:suite]];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
[self addTestsFromSuite:self.detailItem];
|
||||
|
|
|
|||
|
|
@ -36,18 +36,22 @@ void dummy_logger(const char *domain, OrtpLogLevel lev, const char *fmt, va_list
|
|||
for (int k = 0; k < test_count; k++) {
|
||||
const char *test = bc_tester_test_name(suite, k);
|
||||
LOGE(@"\ttest = %s", test);
|
||||
NSString *sSuite = [NSString stringWithUTF8String:suite];
|
||||
NSString *sTest = [NSString stringWithUTF8String:test];
|
||||
if (suite) {
|
||||
NSString *sSuite = [NSString stringWithUTF8String:suite];
|
||||
if (test) {
|
||||
NSString *sTest = [NSString stringWithUTF8String:test];
|
||||
|
||||
// prepend "test_" so that it gets found by introspection
|
||||
NSString *safesTest = [self safetyTestString:sTest];
|
||||
NSString *safesSuite = [self safetyTestString:sSuite];
|
||||
NSString *selectorName = [NSString stringWithFormat:@"test_%@__%@", safesSuite, safesTest];
|
||||
// prepend "test_" so that it gets found by introspection
|
||||
NSString *safesTest = [self safetyTestString:sTest];
|
||||
NSString *safesSuite = [self safetyTestString:sSuite];
|
||||
NSString *selectorName = [NSString stringWithFormat:@"test_%@__%@", safesSuite, safesTest];
|
||||
|
||||
[LinphoneTester_Tests addInstanceMethodWithSelectorName:selectorName
|
||||
block:^(LinphoneTester_Tests *myself) {
|
||||
[myself testForSuite:sSuite andTest:sTest];
|
||||
}];
|
||||
[LinphoneTester_Tests addInstanceMethodWithSelectorName:selectorName
|
||||
block:^(LinphoneTester_Tests *myself) {
|
||||
[myself testForSuite:sSuite andTest:sTest];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue