summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Elias <francois.elias@livio.io>2020-10-16 16:29:41 -0400
committerFrank Elias <francois.elias@livio.io>2020-10-16 16:29:41 -0400
commiteeb04ff3a74f0ad70594d745f3c6c3cc64171dc2 (patch)
tree0adc8b76dfd25cab60f937661c81e0e883aec9c7
parent2d6cddfa3666940dc1eebf9526948c10d63aa349 (diff)
downloadsdl_ios-eeb04ff3a74f0ad70594d745f3c6c3cc64171dc2.tar.gz
Comment review
Re-add tests for autoCompleteText
-rw-r--r--SmartDeviceLink/public/SDLKeyboardProperties.m8
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m25
2 files changed, 24 insertions, 9 deletions
diff --git a/SmartDeviceLink/public/SDLKeyboardProperties.m b/SmartDeviceLink/public/SDLKeyboardProperties.m
index 7adf4ef5a..c21c91bc7 100644
--- a/SmartDeviceLink/public/SDLKeyboardProperties.m
+++ b/SmartDeviceLink/public/SDLKeyboardProperties.m
@@ -11,9 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLKeyboardProperties
- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList {
- SDLKeyboardProperties *keyboardProperties = [[SDLKeyboardProperties alloc] initWithLanguage:language keyboardLayout:layout keypressMode:keypressMode limitedCharacterList:limitedCharacterList autoCompleteList:autoCompleteList];
- keyboardProperties.autoCompleteText = autoCompleteText;
- return keyboardProperties;
+ self = [[self init] initWithLanguage:language keyboardLayout:layout keypressMode:keypressMode limitedCharacterList:limitedCharacterList autoCompleteList:autoCompleteList];
+ if (!self) { return nil; }
+ self.autoCompleteText = autoCompleteText;
+
+ return self;
}
- (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList {
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
index 63428febf..518f20369 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
@@ -33,21 +33,30 @@ describe(@"Getter/Setter Tests", ^ {
testStruct.keypressMode = testMode;
testStruct.limitedCharacterList = testLimitedCharacterList;
testStruct.autoCompleteList = testAutoCompleteList;
-
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ testStruct.autoCompleteText = testAutoCompleteText;
+#pragma clang diagnostic pop
+
expect(testStruct.language).to(equal(testLanguage));
expect(testStruct.keyboardLayout).to(equal(testLayout));
expect(testStruct.keypressMode).to(equal(testMode));
expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
+#pragma clang diagnostic pop
});
it(@"Should get correctly when initialized with a dictionary", ^ {
NSDictionary* dict = @{SDLRPCParameterNameLanguage: testLanguage,
- SDLRPCParameterNameKeyboardLayout: testLayout,
- SDLRPCParameterNameKeypressMode: testMode,
- SDLRPCParameterNameLimitedCharacterList: testLimitedCharacterList,
- SDLRPCParameterNameAutoCompleteList: testAutoCompleteList
- };
+ SDLRPCParameterNameKeyboardLayout: testLayout,
+ SDLRPCParameterNameKeypressMode: testMode,
+ SDLRPCParameterNameLimitedCharacterList: testLimitedCharacterList,
+ SDLRPCParameterNameAutoCompleteList: testAutoCompleteList,
+ SDLRPCParameterNameAutoCompleteText: testAutoCompleteText
+ };
SDLKeyboardProperties* testStruct = [[SDLKeyboardProperties alloc] initWithDictionary:dict];
expect(testStruct.language).to(equal(testLanguage));
@@ -55,6 +64,10 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.keypressMode).to(equal(testMode));
expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
+#pragma clang diagnostic pop
});
it(@"Should get correctly when initialized with initWithLanguage:layout:keypressMode:limitedCharacterList:autoCompleteText:autoCompleteList:", ^ {