Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
eytanbiala authored and thomasvl committed Apr 25, 2022
1 parent 217bc28 commit 7a94cde
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions UnitTesting/GTMGoogleTestRunner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ + (id)defaultTestSuite {
[result addTest:subSuite];
for (int j = 0; j < total_test_count; ++j) {
const TestInfo *test_info = test_case->GetTestInfo(j);
NSString *testName = [NSString stringWithFormat:@"%s.%s", test_case->name(), test_info->name()];
NSString *testName = [NSString
stringWithFormat:@"%s.%s", test_case->name(), test_info->name()];
XCTestCase *xcTest = [[self alloc] initWithName:testName];
[subSuite addTest:xcTest];
}
Expand All @@ -251,9 +252,11 @@ - (id)initWithName:(NSString *)testName {
const char *encoding = method_getTypeEncoding(method);
// We may be called more than once for the same testName. Check before adding new method to avoid
// failure from adding multiple methods with the same name.
if (!class_getInstanceMethod(cls, selector) && !class_addMethod(cls, selector, implementation, encoding)) {
if (!class_getInstanceMethod(cls, selector) &&
!class_addMethod(cls, selector, implementation, encoding)) {
// If we can't add a method, we should blow up here.
[NSException raise:NSInternalInconsistencyException format:@"Unable to add %@ to %@.", testName, cls];
[NSException raise:NSInternalInconsistencyException
format:@"Unable to add %@ to %@.", testName, cls];
}
if ((self = [super initWithSelector:selector])) {
testName_ = testName;
Expand All @@ -264,8 +267,9 @@ - (id)initWithName:(NSString *)testName {
- (NSString *)name {
// An XCTest name must be "-[foo bar]" or it won't be parsed properly.
NSRange dot = [testName_ rangeOfString:@"."];
return [NSString stringWithFormat:@"-[%@ %@]", [testName_ substringToIndex:dot.location],
[testName_ substringFromIndex:dot.location + 1]];
return [NSString
stringWithFormat:@"-[%@ %@]", [testName_ substringToIndex:dot.location],
[testName_ substringFromIndex:dot.location + 1]];
}

- (void)runGoogleTest {
Expand Down

0 comments on commit 7a94cde

Please sign in to comment.