From 4f113cade635363a1b865bafd707c7daf95f29f5 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 12 Jun 2019 15:33:27 -0700 Subject: [darwin] Add warning about certain tests requiring en_US locale --- platform/darwin/test/MGLClockDirectionFormatterTests.m | 7 +++++-- platform/darwin/test/MGLCompassDirectionFormatterTests.m | 5 +++++ platform/darwin/test/MGLCoordinateFormatterTests.m | 5 +++++ platform/darwin/test/MGLNSStringAdditionsTests.m | 2 +- platform/ios/test/MGLMapAccessibilityElementTests.m | 5 +++++ 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 #import -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 = @{ -- cgit v1.2.1