diff --git a/BugsnagNetworkRequestPlugin/BugsnagNetworkRequestPlugin/NSURLSession+Tracing.m b/BugsnagNetworkRequestPlugin/BugsnagNetworkRequestPlugin/NSURLSession+Tracing.m index a60f9be80..e0b8d0444 100644 --- a/BugsnagNetworkRequestPlugin/BugsnagNetworkRequestPlugin/NSURLSession+Tracing.m +++ b/BugsnagNetworkRequestPlugin/BugsnagNetworkRequestPlugin/NSURLSession+Tracing.m @@ -21,7 +21,7 @@ static IMP set_class_imp(Class _Nonnull class, SEL selector, id _Nonnull impleme } } -static void replace_NSURLSession_sessionWithConfigurationDelegateQueue() { +static void replace_NSURLSession_sessionWithConfigurationDelegateQueue(void) { Class class = NSURLSession.class; SEL selector = @selector(sessionWithConfiguration:delegate:delegateQueue:); typedef NSURLSession *(*IMPPrototype)(id, SEL, NSURLSessionConfiguration *, @@ -42,7 +42,7 @@ static void replace_NSURLSession_sessionWithConfigurationDelegateQueue() { }); } -static void replace_NSURLSession_sharedSession() { +static void replace_NSURLSession_sharedSession(void) { set_class_imp(NSURLSession.class, @selector(sharedSession), ^(__unused id self) { static NSURLSession *session; static dispatch_once_t onceToken; @@ -60,7 +60,7 @@ static void replace_NSURLSession_sharedSession() { }); } -void bsg_installNSURLSessionTracing() { +void bsg_installNSURLSessionTracing(void) { replace_NSURLSession_sessionWithConfigurationDelegateQueue(); replace_NSURLSession_sharedSession(); } diff --git a/Tests/BugsnagTests/BugsnagTests.m b/Tests/BugsnagTests/BugsnagTests.m index f7c80bc27..268f76665 100644 --- a/Tests/BugsnagTests/BugsnagTests.m +++ b/Tests/BugsnagTests/BugsnagTests.m @@ -49,6 +49,7 @@ - (void)testBugsnagMetadataAddition { // Add some additional metadata once we're sure it's not already there [client addMetadata:@"aValue2" withKey:@"aKey2" toSection:@"mySection2"]; + return NO; }]; [client notify:exception2 block:^BOOL(BugsnagEvent * _Nonnull event) { @@ -56,6 +57,7 @@ - (void)testBugsnagMetadataAddition { XCTAssertEqualObjects([event getMetadataFromSection:@"mySection2" withKey:@"aKey2"], @"aValue2"); XCTAssertEqual(event.errors[0].errorClass, @"exception2"); XCTAssertEqual(event.errors[0].errorMessage, @"reason2"); + return NO; }]; // Check nil value causes deletions @@ -66,6 +68,7 @@ - (void)testBugsnagMetadataAddition { [client notify:exception1 block:^BOOL(BugsnagEvent * _Nonnull event) { XCTAssertNil([event getMetadataFromSection:@"mySection1" withKey:@"aKey1"]); XCTAssertNil([event getMetadataFromSection:@"mySection2" withKey:@"aKey2"]); + return NO; }]; // Check that event-level metadata alteration doesn't affect configuration-level metadata @@ -85,6 +88,7 @@ - (void)testBugsnagMetadataAddition { [expectation fulfill]; + return NO; }]; [self waitForExpectationsWithTimeout:0.1 handler:^(NSError * _Nullable error) { diff --git a/features/fixtures/shared/scenarios/HandledInternalNotifyScenario.swift b/features/fixtures/shared/scenarios/HandledInternalNotifyScenario.swift index a086b4e71..473ff4308 100644 --- a/features/fixtures/shared/scenarios/HandledInternalNotifyScenario.swift +++ b/features/fixtures/shared/scenarios/HandledInternalNotifyScenario.swift @@ -9,7 +9,7 @@ import Foundation userInfo: nil); Bugsnag.notify(exception) { (event) -> Bool in - let frames = [ + let frames: [[String: Any]] = [ ["method":"foo()", "file":"src/Giraffe.mm", "lineNumber": 200], ["method":"bar()", "file":"parser.js"], ["method":"yes()"] diff --git a/features/fixtures/shared/scenarios/MetadataRedactionNestedScenario.swift b/features/fixtures/shared/scenarios/MetadataRedactionNestedScenario.swift index 714aa6451..d39da1a7a 100644 --- a/features/fixtures/shared/scenarios/MetadataRedactionNestedScenario.swift +++ b/features/fixtures/shared/scenarios/MetadataRedactionNestedScenario.swift @@ -20,7 +20,7 @@ class MetadataRedactionNestedScenario: Scenario { } override func run() { - let dictionary = [ + let dictionary: [String: [String: Any]] = [ "alpha": [ "password": "foo", "name": "Bob" @@ -32,7 +32,7 @@ class MetadataRedactionNestedScenario: Scenario { "name": [ "title": "Mr" ] - ] + ] as [String: Any] ] ] Bugsnag.addOnSession { (block) -> Bool in diff --git a/features/fixtures/shared/scenarios/UnhandledInternalNotifyScenario.swift b/features/fixtures/shared/scenarios/UnhandledInternalNotifyScenario.swift index e0a479aa3..707afd399 100644 --- a/features/fixtures/shared/scenarios/UnhandledInternalNotifyScenario.swift +++ b/features/fixtures/shared/scenarios/UnhandledInternalNotifyScenario.swift @@ -9,7 +9,7 @@ import Foundation userInfo: nil); Bugsnag.notify(exception) { (event) -> Bool in - let frames = [ + let frames: [[String: Any]] = [ ["method":"bar()", "file":"foo.js", "lineNumber": 43], ["method":"baz()", "file":"[native code]"], ["method":"is_done()"] diff --git a/features/fixtures/shared/scenarios/spin_malloc.h b/features/fixtures/shared/scenarios/spin_malloc.h index 96dae0566..2217ee398 100644 --- a/features/fixtures/shared/scenarios/spin_malloc.h +++ b/features/fixtures/shared/scenarios/spin_malloc.h @@ -20,7 +20,7 @@ static void * spin_malloc(struct _malloc_zone_t *zone, size_t size) { } // Override malloc() with a version that deadlocks the current thread. -static inline void install_spin_malloc() { +static inline void install_spin_malloc(void) { malloc_zone_t *zone = malloc_default_zone(); vm_protect(mach_task_self(), (uintptr_t)zone, sizeof(malloc_zone_t), 0, VM_PROT_READ | VM_PROT_WRITE); zone->malloc = spin_malloc;