diff options
author | Julian Rex <julian.rex@mapbox.com> | 2019-09-18 18:13:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 18:13:07 -0400 |
commit | 2b08c1d7bf9e867d6450feb6a246ce36dcdf2cd3 (patch) | |
tree | 8041d2169d2c26041c004c3336de08d031a3f9e8 /platform/darwin/test/MGLOfflinePackTests.m | |
parent | 7bca176beaf4dcae2263eeabee82fd7b6412654b (diff) | |
download | qtlocation-mapboxgl-2b08c1d7bf9e867d6450feb6a246ce36dcdf2cd3.tar.gz |
[ios, macos] Fix MGLOfflinePack invalidate crash (#15582)
Diffstat (limited to 'platform/darwin/test/MGLOfflinePackTests.m')
-rw-r--r-- | platform/darwin/test/MGLOfflinePackTests.m | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/platform/darwin/test/MGLOfflinePackTests.m b/platform/darwin/test/MGLOfflinePackTests.m deleted file mode 100644 index a33665ff0a..0000000000 --- a/platform/darwin/test/MGLOfflinePackTests.m +++ /dev/null @@ -1,40 +0,0 @@ -#import <Mapbox/Mapbox.h> -#import <XCTest/XCTest.h> - -@interface MGLOfflinePackTests : XCTestCase - -@end - -@implementation MGLOfflinePackTests - -- (void)testInvalidation { - MGLOfflinePack *invalidPack = [[MGLOfflinePack alloc] init]; - - XCTAssertEqual(invalidPack.state, MGLOfflinePackStateInvalid, @"Offline pack should be invalid when initialized independently of MGLOfflineStorage."); - - XCTAssertThrowsSpecificNamed(invalidPack.region, NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its region."); - XCTAssertThrowsSpecificNamed(invalidPack.context, NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its context."); - XCTAssertThrowsSpecificNamed([invalidPack resume], NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being resumed."); - XCTAssertThrowsSpecificNamed([invalidPack suspend], NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being suspended."); -} - -- (void)testProgressBoxing { - MGLOfflinePackProgress progress = { - .countOfResourcesCompleted = 3, - .countOfResourcesExpected = 2, - .countOfBytesCompleted = 7, - .countOfTilesCompleted = 1, - .countOfTileBytesCompleted = 6, - .maximumResourcesExpected = UINT64_MAX, - }; - MGLOfflinePackProgress roundTrippedProgress = [NSValue valueWithMGLOfflinePackProgress:progress].MGLOfflinePackProgressValue; - - XCTAssertEqual(progress.countOfResourcesCompleted, roundTrippedProgress.countOfResourcesCompleted, @"Completed resources should round-trip."); - XCTAssertEqual(progress.countOfResourcesExpected, roundTrippedProgress.countOfResourcesExpected, @"Expected resources should round-trip."); - XCTAssertEqual(progress.countOfBytesCompleted, roundTrippedProgress.countOfBytesCompleted, @"Completed bytes should round-trip."); - XCTAssertEqual(progress.countOfTilesCompleted, roundTrippedProgress.countOfTilesCompleted, @"Completed tiles should round-trip."); - XCTAssertEqual(progress.countOfTileBytesCompleted, roundTrippedProgress.countOfTileBytesCompleted, @"Completed tile bytes should round-trip."); - XCTAssertEqual(progress.maximumResourcesExpected, roundTrippedProgress.maximumResourcesExpected, @"Maximum expected resources should round-trip."); -} - -@end |