diff --git a/Shims/Shimulator/TestCrashShim/TestCrashShim.m b/Shims/Shimulator/TestCrashShim/TestCrashShim.m index ac1c19307..d26a30942 100644 --- a/Shims/Shimulator/TestCrashShim/TestCrashShim.m +++ b/Shims/Shimulator/TestCrashShim/TestCrashShim.m @@ -42,7 +42,7 @@ static void PrintProcessInfo(void) FBDebugLog(@"Environment %@", processInfo.environment); } -__attribute__((constructor)) static void EntryPoint() +__attribute__((constructor)) static void EntryPoint(void) { NSLog(@"Start of Shimulator"); diff --git a/Shims/Shimulator/TestLoadingShim/FBXCTestMain.m b/Shims/Shimulator/TestLoadingShim/FBXCTestMain.m index d510acee6..d5002fcf3 100644 --- a/Shims/Shimulator/TestLoadingShim/FBXCTestMain.m +++ b/Shims/Shimulator/TestLoadingShim/FBXCTestMain.m @@ -25,7 +25,7 @@ #import #endif -__attribute__((constructor)) static void XCTestMainEntryPoint() +__attribute__((constructor)) static void XCTestMainEntryPoint(void) { FBDebugLog(@"[XCTestMainEntryPoint] Running inside: %@", [[NSBundle mainBundle] bundleIdentifier]); if (!NSProcessInfo.processInfo.environment[kEnv_ShimStartXCTest]) { @@ -44,7 +44,7 @@ FBDebugLog(@"[XCTestMainEntryPoint] End of XCTestMainEntryPoint"); } -BOOL FBLoadXCTestIfNeeded() +BOOL FBLoadXCTestIfNeeded(void) { FBDebugLog(@"Env: %@", [NSProcessInfo processInfo].environment); @@ -83,7 +83,7 @@ BOOL FBLoadXCTestIfNeeded() return NO; } -void FBDeployBlockWhenAppLoads(void (^mainBlock)()) +void FBDeployBlockWhenAppLoads(void (^mainBlock)(void)) { #if TARGET_OS_IPHONE NSString *notification = UIApplicationDidFinishLaunchingNotification; @@ -113,7 +113,7 @@ static id XCTestCase__xctTestIdentifier(id self, SEL sel) return [[XCTTestIdentifier_class alloc] initWithStringRepresentation:[NSString stringWithFormat:@"%@/%@", classNameOut, methodNameOut] preserveModulePrefix:YES]; } -BOOL FBXCTestMain() +BOOL FBXCTestMain(void) { if (!FBLoadXCTestIfNeeded()) { exit(TestShimExitCodeXCTestFailedLoading); diff --git a/Shims/Shimulator/TestReporterShim/XCTestReporterShim.m b/Shims/Shimulator/TestReporterShim/XCTestReporterShim.m index 85ddba7a1..9a68eb180 100644 --- a/Shims/Shimulator/TestReporterShim/XCTestReporterShim.m +++ b/Shims/Shimulator/TestReporterShim/XCTestReporterShim.m @@ -21,7 +21,6 @@ static NSString *const XCTestFilterArg = @"XCTest"; static NSString *const XCTestFrameworkName = @"XCTest"; -static NSString *const XCTestProbeClassName = @"XCTestProbe"; static NSString *const XCTestSuiteClassName = @"XCTestSuite"; static FILE *__stdout; @@ -63,16 +62,6 @@ return tests; } -// Key used by objc_setAssociatedObject -static int TestDescriptionKey; - -static NSString *TestCase_nameOrDescription(id self, SEL cmd) -{ - id description = objc_getAssociatedObject(self, &TestDescriptionKey); - NSCAssert(description != nil, @"Value for `TestNameKey` wasn't set."); - return description; -} - static char *const kEventQueueLabel = "xctool.events"; @interface XCToolAssertionHandler : NSAssertionHandler @@ -97,7 +86,7 @@ - (void)handleFailureInFunction:(NSString *)functionName @end -static dispatch_queue_t EventQueue() +static dispatch_queue_t EventQueue(void) { static dispatch_queue_t eventQueue = {0}; static dispatch_once_t onceToken; @@ -364,7 +353,7 @@ static void XCPerformTestWithSuppressedExpectedAssertionFailures(id self, SEL or [currentThreadDict removeObjectForKey:NSAssertionHandlerKey]; } -static void XCWaitForDebuggerIfNeeded() +static void XCWaitForDebuggerIfNeeded(void) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -441,7 +430,7 @@ static BOOL XCTestCase__enableSymbolication(id self, SEL sel) * to the pipe reader. Printing "\n" should be safe because reader is skipping * empty lines. */ -static void PrintNewlineAndCloseFDs() +static void PrintNewlineAndCloseFDs(void) { if (__stdout == NULL) { return; @@ -453,7 +442,7 @@ static void PrintNewlineAndCloseFDs() #pragma mark - Entry -static void SwizzleXCTestMethodsIfAvailable() +static void SwizzleXCTestMethodsIfAvailable(void) { if ([[[NSBundle mainBundle] bundleIdentifier] hasPrefix:@"com.apple.dt.xctest"]) { // Start from Xcode 11.1, XCTest will try to connect to testmanagerd service @@ -698,7 +687,7 @@ static id SimServiceContext_deviceSetWithPath_error(id cls, SEL sel, NSString *p return msgsend(cls, originalSelector, simDeviceSetPath, error); } -static void SwizzleXcodebuildMethods() +static void SwizzleXcodebuildMethods(void) { static dispatch_once_t token; dispatch_once(&token, ^{ @@ -719,7 +708,7 @@ static void SwizzleXcodebuildMethods() }); } -__attribute__((constructor)) static void EntryPoint() +__attribute__((constructor)) static void EntryPoint(void) { // Unset so we don't cascade into any other process that might be spawned. unsetenv("DYLD_INSERT_LIBRARIES"); @@ -765,7 +754,7 @@ static void SwizzleXcodebuildMethods() } } -__attribute__((destructor)) static void ExitPoint() +__attribute__((destructor)) static void ExitPoint(void) { PrintNewlineAndCloseFDs(); }