Kaynağa Gözat

Fix failing test #2183 (#2210)

Vladimir Timofeev 6 yıl önce
ebeveyn
işleme
26de9d702f

+ 4
- 6
lib/ios/ReactNativeNavigationTests/RNNCommandsHandlerTest.m Dosyayı Görüntüle

@@ -26,13 +26,11 @@
26 26
 	NSArray* methods = [self getPublicMethodNamesForObject:self.uut];
27 27
 	
28 28
 	for (NSString* methodName in methods) {
29
-		
30
-		__strong id uut = self.uut;
31 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