diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-03-28 18:11:00 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-03-29 11:46:28 -0700 |
commit | 9a556bf24af19bf2788fef447d095d97cff728a2 (patch) | |
tree | f075f9bc5bd98995fbe85274b30d3fa0081aabb6 /platform/osx | |
parent | 38116e39c5832851a585798ab32de3daa03c20e3 (diff) | |
download | qtlocation-mapboxgl-9a556bf24af19bf2788fef447d095d97cff728a2.tar.gz |
[osx] Fixed tests
The previous change includes an additional salient change: a newly minted offline pack’s state is inactive initially, not unknown.
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/test/MGLOfflineStorageTests.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/osx/test/MGLOfflineStorageTests.m b/platform/osx/test/MGLOfflineStorageTests.m index 3657f93d48..8ffa1207ce 100644 --- a/platform/osx/test/MGLOfflineStorageTests.m +++ b/platform/osx/test/MGLOfflineStorageTests.m @@ -55,7 +55,7 @@ XCTestExpectation *additionCompletionHandlerExpectation = [self expectationWithDescription:@"add pack completion handler"]; [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { XCTAssertNotNil(completionHandlerPack, @"Added pack should exist."); - XCTAssertEqual(completionHandlerPack.state, MGLOfflinePackStateUnknown, @"Pack should initially have unknown state."); + XCTAssertEqual(completionHandlerPack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; @@ -72,7 +72,7 @@ XCTAssert([userInfo[nameKey] isKindOfClass:[NSString class]], @"Name of offline pack isn’t a string."); XCTAssertEqualObjects(userInfo[nameKey], name, @"Name of offline pack has changed."); - XCTAssertEqual(pack.state, MGLOfflinePackStateUnknown, @"Pack should initially have unknown state."); + XCTAssertEqual(pack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); [self keyValueObservingExpectationForObject:pack keyPath:@"state" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { NSKeyValueChange changeKind = [change[NSKeyValueChangeKindKey] unsignedIntegerValue]; @@ -96,6 +96,7 @@ return notificationPack == pack && pack.state == MGLOfflinePackStateInactive; }]; + [pack requestProgress]; [self waitForExpectationsWithTimeout:1 handler:nil]; } |