From 63065e1268de9637368aaed4b67591b5cbf09f5b Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Tue, 5 Feb 2019 14:49:00 -0800 Subject: [ios, macos] Update unit test bundle identifier. (#13875) --- platform/darwin/src/MGLOfflineStorage.mm | 2 +- platform/darwin/test/MGLOfflineStorageTests.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index 24aaeb546c..17c1ff3d29 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -159,7 +159,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio NSString *bundleIdentifier = [NSBundle mgl_applicationBundleIdentifier]; if (!bundleIdentifier) { // There’s no main bundle identifier when running in a unit test bundle. - bundleIdentifier = [NSBundle bundleForClass:self].bundleIdentifier; + bundleIdentifier = [[NSUUID UUID] UUIDString]; } cacheDirectoryURL = [cacheDirectoryURL URLByAppendingPathComponent:bundleIdentifier]; if (useSubdirectory) { diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index 6fb787b556..7f0ead7cab 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -333,7 +333,7 @@ MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; [os addContentsOfFile:filePath withCompletionHandler:^(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error) { XCTAssertNotNil(fileURL, @"The fileURL should not be nil."); - XCTAssertNotNil(packs, @"Adding the contents of the barcelona.db should update one pack."); + XCTAssertNotNil(packs, @"Adding the contents of the sideload_sat.db should update one pack."); XCTAssertNil(error, @"Adding contents to a file should not return an error."); for (MGLOfflinePack *pack in [MGLOfflineStorage sharedOfflineStorage].packs) { NSLog(@"PACK:%@", pack); @@ -342,7 +342,7 @@ }]; [self waitForExpectationsWithTimeout:10 handler:nil]; // Depending on the database it may update or add a pack. For this case specifically the offline database adds one pack. - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Adding contents of barcelona.db should add one pack."); + XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Adding contents of sideload_sat.db should add one pack."); } // Invalid database type -- cgit v1.2.1