diff options
author | Jason Wray <jason@mapbox.com> | 2019-06-12 15:33:27 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2019-06-12 15:34:08 -0700 |
commit | 4f113cade635363a1b865bafd707c7daf95f29f5 (patch) | |
tree | afb8d82937327007f4de06122de237a1b0610150 | |
parent | 6b7d3a16c0e626d2f999e8358c4a0da2af75de87 (diff) | |
download | qtlocation-mapboxgl-upstream/friedbunny-adds-unit-test-locale-fixmes.tar.gz |
[darwin] Add warning about certain tests requiring en_US localeupstream/friedbunny-adds-unit-test-locale-fixmes
5 files changed, 21 insertions, 3 deletions
diff --git a/platform/darwin/test/MGLClockDirectionFormatterTests.m b/platform/darwin/test/MGLClockDirectionFormatterTests.m index 13e12ae2f2..1b2f058d18 100644 --- a/platform/darwin/test/MGLClockDirectionFormatterTests.m +++ b/platform/darwin/test/MGLClockDirectionFormatterTests.m @@ -1,14 +1,17 @@ #import <Mapbox/Mapbox.h> #import <XCTest/XCTest.h> -static NSString * const MGLTestLocaleIdentifier = @"en-US"; - @interface MGLClockDirectionFormatterTests : XCTestCase @end @implementation MGLClockDirectionFormatterTests +- (void)setUp { + // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908 + XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass."); +} + - (void)testClockDirections { MGLClockDirectionFormatter *shortFormatter = [[MGLClockDirectionFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; diff --git a/platform/darwin/test/MGLCompassDirectionFormatterTests.m b/platform/darwin/test/MGLCompassDirectionFormatterTests.m index c4ccc6ac4f..cd3aaebab7 100644 --- a/platform/darwin/test/MGLCompassDirectionFormatterTests.m +++ b/platform/darwin/test/MGLCompassDirectionFormatterTests.m @@ -7,6 +7,11 @@ @implementation MGLCompassDirectionFormatterTests +- (void)setUp { + // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908 + XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass."); +} + - (void)testCompassDirections { MGLCompassDirectionFormatter *shortFormatter = [[MGLCompassDirectionFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; diff --git a/platform/darwin/test/MGLCoordinateFormatterTests.m b/platform/darwin/test/MGLCoordinateFormatterTests.m index ac083fa103..4d4d8cf971 100644 --- a/platform/darwin/test/MGLCoordinateFormatterTests.m +++ b/platform/darwin/test/MGLCoordinateFormatterTests.m @@ -7,6 +7,11 @@ @implementation MGLCoordinateFormatterTests +- (void)setUp { + // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908 + XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass."); +} + - (void)testStrings { MGLCoordinateFormatter *shortFormatter = [[MGLCoordinateFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; diff --git a/platform/darwin/test/MGLNSStringAdditionsTests.m b/platform/darwin/test/MGLNSStringAdditionsTests.m index 571cf49d7f..872a8ce664 100644 --- a/platform/darwin/test/MGLNSStringAdditionsTests.m +++ b/platform/darwin/test/MGLNSStringAdditionsTests.m @@ -9,7 +9,7 @@ @implementation MGLNSStringAdditionsTests - (void)testTitleCasedString { - NSLocale *locale = [NSLocale currentLocale]; + NSLocale *locale = [NSLocale localeWithLocaleIdentifier:@"en_US"]; XCTAssertEqualObjects([@"© OpenStreetMap" mgl_titleCasedStringWithLocale:locale], @"© OpenStreetMap"); XCTAssertEqualObjects([@"© OSM" mgl_titleCasedStringWithLocale:locale], @"© OSM"); diff --git a/platform/ios/test/MGLMapAccessibilityElementTests.m b/platform/ios/test/MGLMapAccessibilityElementTests.m index 916461e708..2312d1d406 100644 --- a/platform/ios/test/MGLMapAccessibilityElementTests.m +++ b/platform/ios/test/MGLMapAccessibilityElementTests.m @@ -8,6 +8,11 @@ @implementation MGLMapAccessibilityElementTests +- (void)setUp { + // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908 + XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass."); +} + - (void)testFeatureLabels { MGLPointFeature *feature = [[MGLPointFeature alloc] init]; feature.attributes = @{ |