summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM.Stephen <truestyle2005@163.com>2019-07-09 14:59:47 +0800
committerM.Stephen <truestyle2005@163.com>2019-07-09 14:59:47 +0800
commit7e4b86bec7a8ee3e6ca1d22b740561936d2e7a19 (patch)
tree854068ca5572c9b6fca068e5c9defea58f616d50
parentbd979aec51cffc146c250146f327fc1851beb704 (diff)
downloadqtlocation-mapboxgl-7e4b86bec7a8ee3e6ca1d22b740561936d2e7a19.tar.gz
[iOS, macOS] add invalid value type test
-rw-r--r--platform/darwin/test/MGLRendererConfigurationTests.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLRendererConfigurationTests.mm b/platform/darwin/test/MGLRendererConfigurationTests.mm
index c06d0a6f64..8d4142a149 100644
--- a/platform/darwin/test/MGLRendererConfigurationTests.mm
+++ b/platform/darwin/test/MGLRendererConfigurationTests.mm
@@ -178,6 +178,20 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M
#endif
XCTAssertEqual(localFontFamilyName, systemFontFamilyName, @"Local font family name should match default system font name when setting an invalid font family names array");
}
+
+ // `MGLIdeographicFontFamilyName` set to an invalid value type: NSDictionary, NSNumber, NSData, etc.
+ {
+ dic = @{@"MGLIdeographicFontFamilyName": [@"test font 1" dataUsingEncoding:NSUTF8StringEncoding]};
+ std::string localFontFamilyName = ([config _localFontFamilyNameWithPropertyDictionary:dic]).value();
+
+ std::string systemFontFamilyName;
+#if TARGET_OS_IPHONE
+ systemFontFamilyName = std::string([[UIFont systemFontOfSize:0 weight:UIFontWeightRegular].familyName UTF8String]);
+#else
+ systemFontFamilyName = std::string([[NSFont systemFontOfSize:0 weight:NSFontWeightRegular].familyName UTF8String]);
+#endif
+ XCTAssertEqual(localFontFamilyName, systemFontFamilyName, @"Local font family name should match default system font name when setting an invalid value type");
+ }
}