If a test name is null do not try to run the test

This commit is contained in:
Benjamin Reis 2017-01-03 14:19:50 +01:00
parent ddd86658c9
commit 10bd05e4cd

View file

@ -66,9 +66,11 @@ static NSString *const kAllTestsName = @"Run All tests";
for (int i = 0; i < count; i++) {
const char *test_name = bc_tester_test_name([suite UTF8String], i);
NSString *testName = [NSString stringWithUTF8String:test_name];
TestItem *item = [[TestItem alloc] initWithName:testName fromSuite:suite];
[_tests addObject:item];
if (test_name) {
NSString *testName = [NSString stringWithUTF8String:test_name];
TestItem *item = [[TestItem alloc] initWithName:testName fromSuite:suite];
[_tests addObject:item];
}
}
}
@ -81,7 +83,8 @@ 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 *tmp = bc_tester_suite_name(i);
[self addTestsFromSuite:[NSString stringWithUTF8String:tmp]];
}
} else {
[self addTestsFromSuite:self.detailItem];