Remove warnings in RCTBridgeTests

Reviewed By: majak

Differential Revision: D2771228

fb-gh-sync-id: dd935094ceeff196c272565bf7efea5112059a1a
This commit is contained in:
Pieter De Baets 2015-12-23 14:41:39 -08:00 committed by facebook-github-bot-9
parent 0cfe76399c
commit 4fde511f5c
2 changed files with 12 additions and 12 deletions

View File

@ -51,16 +51,16 @@ RCT_EXPORT_MODULE()
onComplete(nil, nil); onComplete(nil, nil);
} }
- (void)callFunctionOnModule:(NSString *)module - (void)callFunctionOnModule:(__unused NSString *)module
method:(NSString *)method method:(__unused NSString *)method
arguments:(NSArray *)args arguments:(__unused NSArray *)args
callback:(RCTJavaScriptCallback)onComplete callback:(RCTJavaScriptCallback)onComplete
{ {
onComplete(nil, nil); onComplete(nil, nil);
} }
- (void)invokeCallbackID:(NSNumber *)cbID - (void)invokeCallbackID:(__unused NSNumber *)cbID
arguments:(NSArray *)args arguments:(__unused NSArray *)args
callback:(RCTJavaScriptCallback)onComplete callback:(RCTJavaScriptCallback)onComplete
{ {
onComplete(nil, nil); onComplete(nil, nil);
@ -121,7 +121,9 @@ RCT_EXPORT_MODULE(TestModule)
- (void)tearDown - (void)tearDown
{ {
[super tearDown]; [super tearDown];
[_bridge invalidate]; [_bridge invalidate];
_testMethodCalled = NO;
} }
#define RUN_RUNLOOP_WHILE(CONDITION) \ #define RUN_RUNLOOP_WHILE(CONDITION) \
@ -169,21 +171,22 @@ _Pragma("clang diagnostic pop")
RUN_RUNLOOP_WHILE(!(injectedStuff = executor.injectedStuff[@"__fbBatchedBridgeConfig"])); RUN_RUNLOOP_WHILE(!(injectedStuff = executor.injectedStuff[@"__fbBatchedBridgeConfig"]));
__block NSNumber *testModuleID = nil; __block NSNumber *testModuleID = nil;
__block NSDictionary<NSString *, id> *testConstants = nil;
__block NSNumber *testMethodID = nil; __block NSNumber *testMethodID = nil;
NSArray *remoteModuleConfig = RCTJSONParse(injectedStuff, NULL)[@"remoteModuleConfig"]; NSArray *remoteModuleConfig = RCTJSONParse(injectedStuff, NULL)[@"remoteModuleConfig"];
[remoteModuleConfig enumerateObjectsUsingBlock:^(id moduleConfig, NSUInteger i, __unused BOOL *stop) { [remoteModuleConfig enumerateObjectsUsingBlock:^(id moduleConfig, NSUInteger i, __unused BOOL *stop) {
if ([moduleConfig isKindOfClass:[NSArray class]] && [moduleConfig[0] isEqualToString:@"TestModule"]) { if ([moduleConfig isKindOfClass:[NSArray class]] && [moduleConfig[0] isEqualToString:@"TestModule"]) {
testModuleID = @(i); testModuleID = @(i);
testConstants = moduleConfig[1];
testMethodID = @([moduleConfig[2] indexOfObject:@"testMethod"]); testMethodID = @([moduleConfig[2] indexOfObject:@"testMethod"]);
*stop = YES; *stop = YES;
} }
}]; }];
XCTAssertNotNil(testModuleID);
XCTAssertNotNil(testMethodID);
NSArray *args = @[@1234, @5678, @"stringy", @{@"a": @1}, @42]; NSArray *args = @[@1234, @5678, @"stringy", @{@"a": @1}, @42];
NSArray *buffer = @[@[testModuleID], @[testMethodID], @[args], @[], @1234567]; NSArray *buffer = @[@[testModuleID], @[testMethodID], @[args]];
[_bridge.batchedBridge handleBuffer:buffer]; [_bridge.batchedBridge handleBuffer:buffer];

View File

@ -818,10 +818,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
dispatch_block_t block = ^{ dispatch_block_t block = ^{
RCTProfileEndFlowEvent(); RCTProfileEndFlowEvent();
#if RCT_DEV RCT_PROFILE_BEGIN_EVENT(0, RCTCurrentThreadName(), nil);
NSString *_threadName = RCTCurrentThreadName();
RCT_PROFILE_BEGIN_EVENT(0, _threadName, nil);
#endif
NSOrderedSet *calls = [buckets objectForKey:queue]; NSOrderedSet *calls = [buckets objectForKey:queue];
@autoreleasepool { @autoreleasepool {