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

View File

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