mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-23 14:18:07 +00:00
Fix test selector name with bad characters
This commit is contained in:
parent
234f86cf4e
commit
b73584e634
1 changed files with 10 additions and 4 deletions
|
|
@ -57,6 +57,13 @@ void LSLog(NSString* fmt, ...){
|
|||
return skipped_suites;
|
||||
}
|
||||
|
||||
|
||||
+ (NSString*)safeifyTestString:(NSString*)testString{
|
||||
NSCharacterSet *charactersToRemove = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
|
||||
return [[testString componentsSeparatedByCharactersInSet:charactersToRemove] componentsJoinedByString:@"_"];
|
||||
}
|
||||
|
||||
|
||||
+ (void)initialize {
|
||||
liblinphone_tester_init();
|
||||
|
||||
|
|
@ -72,10 +79,9 @@ void LSLog(NSString* fmt, ...){
|
|||
NSString* sTest = [NSString stringWithUTF8String:test];
|
||||
|
||||
if( [[LinphoneTester_Tests skippedSuites] containsObject:sSuite] ) continue;
|
||||
|
||||
// prepend test_ so that it gets found by introspection
|
||||
NSString* safesTest = [sTest stringByReplacingOccurrencesOfString:@" " withString:@"_"];
|
||||
NSString* safesSuite = [sSuite stringByReplacingOccurrencesOfString:@" " withString:@"_"];
|
||||
// prepend test_ so that it gets found by introspection
|
||||
NSString* safesTest = [self safeifyTestString:sTest];
|
||||
NSString* safesSuite = [self safeifyTestString:sSuite];
|
||||
NSString *selectorName = [NSString stringWithFormat:@"test_%@__%@", safesSuite, safesTest];
|
||||
[LinphoneTester_Tests addInstanceMethodWithSelectorName:selectorName block:^(LinphoneTester_Tests* myself) {
|
||||
[myself testForSuite:sSuite andTest:sTest];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue