diff options
Diffstat (limited to 'platform/ios/test/MGLNSDataAdditionsTests.m')
-rw-r--r-- | platform/ios/test/MGLNSDataAdditionsTests.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/ios/test/MGLNSDataAdditionsTests.m b/platform/ios/test/MGLNSDataAdditionsTests.m index b01db25812..8d145be4a0 100644 --- a/platform/ios/test/MGLNSDataAdditionsTests.m +++ b/platform/ios/test/MGLNSDataAdditionsTests.m @@ -10,28 +10,28 @@ - (void)testCompressDecompress { NSArray *originalArray = [self mockDataWithCount:180]; - + NSData *originalData = [NSJSONSerialization dataWithJSONObject:originalArray options:0 error:nil]; - + NSData *compressedData = [originalData mgl_compressedData]; NSData *decompressedData = [compressedData mgl_decompressedData]; - + NSArray *decompressedArray = [NSJSONSerialization JSONObjectWithData:decompressedData options:0 error:nil]; - + XCTAssertTrue([originalArray isEqualToArray:decompressedArray], @"originalArray and decompressedArray should be equal"); } - (NSArray *)mockDataWithCount:(NSUInteger)count { NSMutableArray *array = [NSMutableArray array]; - + for (NSUInteger i=0;i<count;i++) { [array addObject:@{@"lat": @([self safeValueBetween:-90 and:90]), @"lng": @([self safeValueBetween:-180 and:180]), @"timestamp": @((floor([NSDate date].timeIntervalSince1970) * 100) / 100)}]; } - + return array; } |