diff --git a/FirebasePerformance/Sources/Instrumentation/FPRSelectorInstrumentor.m b/FirebasePerformance/Sources/Instrumentation/FPRSelectorInstrumentor.m index 0f474e5436a..63fe708d223 100644 --- a/FirebasePerformance/Sources/Instrumentation/FPRSelectorInstrumentor.m +++ b/FirebasePerformance/Sources/Instrumentation/FPRSelectorInstrumentor.m @@ -17,9 +17,6 @@ #import "FirebasePerformance/Sources/Common/FPRDiagnostics.h" #import -#ifdef UNSWIZZLE_AVAILABLE -#import -#endif @implementation FPRSelectorInstrumentor { // The class this instrumentor operates on. @@ -76,11 +73,8 @@ - (void)swizzle { - (void)unswizzle { _swizzled = NO; -#ifdef UNSWIZZLE_AVAILABLE - [GULSwizzler unswizzleClass:_class selector:_selector isClassSelector:_isClassSelector]; -#else - NSAssert(NO, @"Unswizzling is disabled."); -#endif + // For the SDK, we do not unswizzle, but this does run in unit tests, + // though it does not seem to have any effect } - (IMP)currentIMP { diff --git a/FirebasePerformance/Tests/Unit/FPRClassInstrumentorTest.m b/FirebasePerformance/Tests/Unit/FPRClassInstrumentorTest.m index 5e07dd9a3ea..0b72ea5cd9a 100644 --- a/FirebasePerformance/Tests/Unit/FPRClassInstrumentorTest.m +++ b/FirebasePerformance/Tests/Unit/FPRClassInstrumentorTest.m @@ -57,8 +57,6 @@ - (void)testCannotInstrumentSameSelectorTwice { #pragma mark - Unswizzle based tests -#if !SWIFT_PACKAGE - /** Tests swizzling an instance selector. */ - (void)testSwizzleInstanceSelector { FPRClassInstrumentor *classInstrumentor = @@ -158,6 +156,4 @@ - (void)testVoidReturnClassSelector { [classInstrumentor unswizzle]; } -#endif // SWIFT_PACKAGE - @end diff --git a/FirebasePerformance/Tests/Unit/FPRInstrumentTest.m b/FirebasePerformance/Tests/Unit/FPRInstrumentTest.m index 245d0ac0d47..82a2af6f64b 100644 --- a/FirebasePerformance/Tests/Unit/FPRInstrumentTest.m +++ b/FirebasePerformance/Tests/Unit/FPRInstrumentTest.m @@ -65,8 +65,6 @@ - (void)testRegisterAlreadyRegisteredClassInstrumentor { #pragma mark - Unswizzle based tests -#if !SWIFT_PACKAGE - - (void)testDeregisterInstrumentors { FPRInstrument *instrument = [[FPRInstrument alloc] init]; FPRClassInstrumentor *classInstrumentor = @@ -86,6 +84,4 @@ - (void)testDeregisterInstrumentors { [classInstrumentor unswizzle]; } -#endif // SWIFT_PACKAGE - @end diff --git a/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTest.m b/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTest.m index bb3e3520f39..c6c9f65bf2b 100644 --- a/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTest.m +++ b/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTest.m @@ -14,8 +14,6 @@ #pragma mark - Unswizzle based tests -#if !SWIFT_PACKAGE - #import "FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTestDelegates.h" #import @@ -519,5 +517,3 @@ - (void)testDownloadDelegateCompletionAPIGetsCalledEvenIfDataDelegateIsImplement } @end - -#endif // SWIFT_PACKAGE diff --git a/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLSessionInstrumentTest.m b/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLSessionInstrumentTest.m index ffffbe17c17..33866ad20e4 100644 --- a/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLSessionInstrumentTest.m +++ b/FirebasePerformance/Tests/Unit/Instruments/FPRNSURLSessionInstrumentTest.m @@ -14,8 +14,6 @@ #pragma mark - Unswizzle based tests -#ifndef SWIFT_PACKAGE - #import "FirebasePerformance/Tests/Unit/Instruments/FPRNSURLSessionInstrumentTestDelegates.h" #import @@ -836,5 +834,3 @@ - (void)testMutableRequestURLs { } @end - -#endif // SWIFT_PACKAGE diff --git a/FirebasePerformance/Tests/Unit/Instruments/FPRUIViewControllerInstrumentTest.m b/FirebasePerformance/Tests/Unit/Instruments/FPRUIViewControllerInstrumentTest.m index 005818f63a0..fba807116cf 100644 --- a/FirebasePerformance/Tests/Unit/Instruments/FPRUIViewControllerInstrumentTest.m +++ b/FirebasePerformance/Tests/Unit/Instruments/FPRUIViewControllerInstrumentTest.m @@ -14,8 +14,6 @@ #pragma mark - Unswizzle based tests -#if !SWIFT_PACKAGE - #import "FirebasePerformance/Sources/Instrumentation/UIKit/FPRUIViewControllerInstrument.h" #import @@ -54,6 +52,8 @@ - (void)setUp { originalViewDidDisappearInvoked = NO; } +#if !SWIFT_PACKAGE + /** Tests that the viewControllerDidAppear: of the FPRScreenTraceTracker sharedInstance is invoked * when a UIViewController's viewDidAppear: is invoked. */ @@ -77,6 +77,8 @@ - (void)testViewDidAppearInvokesViewControllerDidAppearOnScreenTraceTracker { [[testViewController view] removeFromSuperview]; } +#endif // SWIFT_PACKAGE + /** Tests that the viewControllerDidAppear: of the FPRScreenTraceTracker sharedInstance is invoked * when a UIViewController's viewDidAppear: is invoked. */ @@ -172,5 +174,3 @@ - (void)testViewDidAppearInvokesPreviousViewDidDisappear { } @end - -#endif // SWIFT_PACKAGE