diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-10-03 10:34:21 -0700 |
---|---|---|
committer | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2018-10-04 11:04:15 -0700 |
commit | 710a7f5037f0c369092a9612b72f82c0faa0865e (patch) | |
tree | 2e7c197701c33a6bd8596883af2e42a4f240df65 /platform/darwin | |
parent | 9cf023b90f02eb5badc57564ae18ace5100b989d (diff) | |
download | qtlocation-mapboxgl-710a7f5037f0c369092a9612b72f82c0faa0865e.tar.gz |
[ios, macos] Enable offline merge test.
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/test/MGLOfflineStorageTests.mm | 14 | ||||
-rw-r--r-- | platform/darwin/test/barcelona.db | bin | 32391168 -> 0 bytes |
2 files changed, 6 insertions, 8 deletions
diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index 0eba272efb..4d17ef0455 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -295,10 +295,8 @@ // Valid database { - // TODO: Fix the size of barcelone.db that is causing timeouts. - /** - NSURL *resourceURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"barcelona" ofType:@"db"]]; - NSString *filePath = [documentDir stringByAppendingPathComponent:@"barcelona.db"]; + NSURL *resourceURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"sideload_sat" ofType:@"db"]]; + NSString *filePath = [documentDir stringByAppendingPathComponent:@"sideload_sat.db"]; BOOL databaseExists = [fileManager fileExistsAtPath:filePath]; if (databaseExists) { @@ -316,7 +314,7 @@ NSNumber *fileSizeNumber = [fileAttributes objectForKey:NSFileSize]; long long fileSize = [fileSizeNumber longLongValue]; - long long databaseFileSize = 32391168; + long long databaseFileSize = 73728; // Merging databases creates an empty file if the file does not exist at the given path. XCTAssertEqual(fileSize, databaseFileSize, @"The database file size must be:%lld actual size:%lld", databaseFileSize, fileSize); @@ -339,10 +337,10 @@ } [fileAdditionCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [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."); - */ + } // Invalid database type { @@ -367,7 +365,7 @@ XCTAssertNil(packs, @"Passing an invalid offline database file should not add packs to the offline database."); [invalidFileCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:10 handler:nil]; } // File non existent { diff --git a/platform/darwin/test/barcelona.db b/platform/darwin/test/barcelona.db Binary files differdeleted file mode 100644 index a3c2284202..0000000000 --- a/platform/darwin/test/barcelona.db +++ /dev/null |