Browse Source

Fix failing test #2183 (#2210)

Vladimir Timofeev 6 years ago
parent
commit
26de9d702f
1 changed files with 4 additions and 6 deletions
  1. 4
    6
      lib/ios/ReactNativeNavigationTests/RNNCommandsHandlerTest.m

+ 4
- 6
lib/ios/ReactNativeNavigationTests/RNNCommandsHandlerTest.m View File

26
 	NSArray* methods = [self getPublicMethodNamesForObject:self.uut];
26
 	NSArray* methods = [self getPublicMethodNamesForObject:self.uut];
27
 	
27
 	
28
 	for (NSString* methodName in methods) {
28
 	for (NSString* methodName in methods) {
29
-		
30
-		__strong id uut = self.uut;
31
 		SEL s = NSSelectorFromString(methodName);
29
 		SEL s = NSSelectorFromString(methodName);
32
-		IMP imp = [uut methodForSelector:s];
33
-		void (*func)(id, SEL) = (void *)imp;
34
-		
35
-		XCTAssertThrowsSpecificNamed(func(uut,s), NSException, @"BridgeNotLoadedError");
30
+		NSMethodSignature* signature = [self.uut methodSignatureForSelector:s];
31
+		NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature];
32
+		invocation.selector = s;
33
+		XCTAssertThrowsSpecificNamed([invocation invokeWithTarget:self.uut], NSException, @"BridgeNotLoadedError");
36
 	}
34
 	}
37
 }
35
 }
38
 
36