summaryrefslogtreecommitdiff
path: root/platform/ios/test/MGLNSDataAdditionsTests.m
diff options
context:
space:
mode:
authorJesse Crocker <jesse@gaiagps.com>2017-03-01 11:15:11 -0700
committerJesse Crocker <jesse@gaiagps.com>2017-03-01 11:15:11 -0700
commit9e8dc9a9e3e86adb9987ae69766cc42c7d9efece (patch)
treef5f0abd4d342c89ad0405d01969f9d6caecc1c90 /platform/ios/test/MGLNSDataAdditionsTests.m
parent16fb0672e64a72b7400c321d55858b73cd5d8c3f (diff)
parentf28d75dccd9bf4a7615df87faccc5cf5eff8df89 (diff)
downloadqtlocation-mapboxgl-9e8dc9a9e3e86adb9987ae69766cc42c7d9efece.tar.gz
Merge remote-tracking branch 'origin/master' into feature/custom-vector-source
Diffstat (limited to 'platform/ios/test/MGLNSDataAdditionsTests.m')
-rw-r--r--platform/ios/test/MGLNSDataAdditionsTests.m12
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;
}