diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-02-05 14:49:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 14:49:00 -0800 |
commit | 63065e1268de9637368aaed4b67591b5cbf09f5b (patch) | |
tree | be43acecd15b7f0cf9db200825080a486e8a3340 | |
parent | 5ba4a6a980119010fba6515a14d3a67a73dd4672 (diff) | |
download | qtlocation-mapboxgl-63065e1268de9637368aaed4b67591b5cbf09f5b.tar.gz |
[ios, macos] Update unit test bundle identifier. (#13875)
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.mm | 2 | ||||
-rw-r--r-- | 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<MGLOfflinePack *> * _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 |