From 38510f15b95409cf125a23c5345cf9ce07fd2d3a Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 12 Apr 2024 10:56:08 -0400 Subject: [PATCH] Remove need for UUID namespaced defaults --- .../Tests/Unit/FIRIAMBookKeeperViaUserDefaultsTests.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FirebaseInAppMessaging/Tests/Unit/FIRIAMBookKeeperViaUserDefaultsTests.m b/FirebaseInAppMessaging/Tests/Unit/FIRIAMBookKeeperViaUserDefaultsTests.m index b295e4a5521..499f4228609 100644 --- a/FirebaseInAppMessaging/Tests/Unit/FIRIAMBookKeeperViaUserDefaultsTests.m +++ b/FirebaseInAppMessaging/Tests/Unit/FIRIAMBookKeeperViaUserDefaultsTests.m @@ -30,18 +30,19 @@ @interface FIRIAMBookKeeperViaUserDefaultsTests : XCTestCase extern NSString *FIRIAM_ImpressionDictKeyForID; extern NSString *FIRIAM_ImpressionDictKeyForTimestamp; +static NSString *const kSuiteName = @"FIRIAMBookKeeperViaUserDefaultsTests"; + @implementation FIRIAMBookKeeperViaUserDefaultsTests - (void)setUp { [super setUp]; - NSString *suiteName = [[NSString alloc] - initWithFormat:@"FIRIAMBookKeeperViaUserDefaultsTests-%@", [NSUUID UUID].UUIDString]; - self.userDefaultsForTesting = [[GULUserDefaults alloc] initWithSuiteName:suiteName]; + self.userDefaultsForTesting = [[GULUserDefaults alloc] initWithSuiteName:kSuiteName]; } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the // class. [super tearDown]; + [[[NSUserDefaults alloc] initWithSuiteName:kSuiteName] removePersistentDomainForName:kSuiteName]; } - (void)testRecordImpressionRecords {