Skip to content

Commit 6602a9b

Browse files
maksymmalyhinCorrob
authored andcommitted
GULAppDelegateSwizzlerTests fix (#2657)
1 parent 7663f98 commit 6602a9b

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

GoogleUtilities/AppDelegateSwizzler/GULAppDelegateSwizzler.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ + (void)createSubclassWithObject:(id<UIApplicationDelegate>)anObject {
277277
// Create GUL_<RealAppDelegate>_<timestampMs>
278278
NSString *classNameWithPrefix =
279279
[kGULAppDelegatePrefix stringByAppendingString:NSStringFromClass(realClass)];
280-
NSTimeInterval timestamp = [NSDate date].timeIntervalSince1970;
281280
NSString *newClassName =
282-
[NSString stringWithFormat:@"%@-%0.0f", classNameWithPrefix, timestamp * 1000];
281+
[NSString stringWithFormat:@"%@-%@", classNameWithPrefix, [NSUUID UUID].UUIDString];
283282

284283
if (NSClassFromString(newClassName)) {
285284
GULLogError(kGULLoggerSwizzler, NO,

GoogleUtilities/Example/GoogleUtilities.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
1414
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
1515
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
16+
9A7C37C2224BD9C600033B0D /* GULAppDelegateSwizzlerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EFBE67F92101401100E756A7 /* GULAppDelegateSwizzlerTest.m */; };
1617
DE5CF98E20F686310063FFDD /* GULAppEnvironmentUtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DE5CF98C20F686290063FFDD /* GULAppEnvironmentUtilTest.m */; };
1718
DE84BBC421D7EC900048A176 /* GULUserDefaultsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE84BBC321D7EC900048A176 /* GULUserDefaultsTests.m */; };
1819
DE84BBC521D7EC900048A176 /* GULUserDefaultsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE84BBC321D7EC900048A176 /* GULUserDefaultsTests.m */; };
@@ -618,6 +619,7 @@
618619
DEC977D920F68C3300014E20 /* GULNetworkTest.m in Sources */,
619620
EFBE67FA2101401100E756A7 /* GULSwizzlerTest.m in Sources */,
620621
EFBE67FD2101401100E756A7 /* GULObjectSwizzlerTest.m in Sources */,
622+
9A7C37C2224BD9C600033B0D /* GULAppDelegateSwizzlerTest.m in Sources */,
621623
EFBE67FE2101401100E756A7 /* GULRuntimeClassSnapshotTests.m in Sources */,
622624
EFBE67FC2101401100E756A7 /* GULRuntimeClassDiffTests.m in Sources */,
623625
DE5CF98E20F686310063FFDD /* GULAppEnvironmentUtilTest.m in Sources */,

GoogleUtilities/Example/GoogleUtilities.xcodeproj/xcshareddata/xcschemes/Example_iOS.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
codeCoverageEnabled = "YES"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference

GoogleUtilities/Example/Tests/Swizzler/GULAppDelegateSwizzlerTest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ @implementation GULAppDelegateSwizzlerTest
199199

200200
- (void)tearDown {
201201
[GULAppDelegateSwizzler clearInterceptors];
202+
[super tearDown];
202203
}
203204

204205
/** Tests proxying an object that responds to UIApplicationDelegate protocol and makes sure that

0 commit comments

Comments
 (0)