diff options
author | NicoleYarroch <nicole@livio.io> | 2019-03-12 16:32:34 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-03-12 16:32:34 -0400 |
commit | 3922ac710171a32d1e2713345fa55eba0906c9a4 (patch) | |
tree | 81de4d5cd8dedb908a8ddbc28d5cf51111e2d8cd | |
parent | 19aef6f12d77c954491853236897b0efa4dd6aeb (diff) | |
download | sdl_ios-3922ac710171a32d1e2713345fa55eba0906c9a4.tar.gz |
Fixed method names in `SDLVersion` + test cases
* Fixed `isGreaterThanOrEqualToVersion:`
* Added `isLessThanOrEqualToVersion:`
* Added test cases to SDLVersionSpec
* Fixed some documentation
-rw-r--r-- | SmartDeviceLink/SDLCloudAppProperties.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLManager.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProtocol.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVersion.h | 3 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVersion.m | 6 | ||||
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLVersionSpec.m | 4 |
6 files changed, 16 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLCloudAppProperties.h b/SmartDeviceLink/SDLCloudAppProperties.h index 1bd1f742f..76fa3b6b6 100644 --- a/SmartDeviceLink/SDLCloudAppProperties.h +++ b/SmartDeviceLink/SDLCloudAppProperties.h @@ -29,9 +29,9 @@ NS_ASSUME_NONNULL_BEGIN /** * Convenience init for all parameters. * - * @param nicknames An array of app names a cloud app is allowed to register with * @param appID The id of the cloud app - * @param enabled If true, cloud app will be included in HMI RPC UpdateAppList + * @param nicknames An array of app names a cloud app is allowed to register with + * @param enabled If true, the cloud app will appear in the HMI's app list; if false, the cloud app will not appear in the HMI's app list * @param authToken Used to authenticate websocket connection on app activation * @param cloudTransportType Specifies the connection type Core should use * @param hybridAppPreference Specifies the user preference to use the cloud app version or mobile app version when both are available @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) NSString *appID; /** - * If true, cloud app will be included in HMI RPC UpdateAppList. + * If true, the cloud app will appear in the HMI's app list; if false, the cloud app will not appear in the HMI's app list. * * Boolean, Optional */ diff --git a/SmartDeviceLink/SDLManager.h b/SmartDeviceLink/SDLManager.h index 09fa44322..91aece5e5 100644 --- a/SmartDeviceLink/SDLManager.h +++ b/SmartDeviceLink/SDLManager.h @@ -85,7 +85,7 @@ typedef void (^SDLManagerReadyBlock)(BOOL success, NSError *_Nullable error); @property (strong, nonatomic, readonly, nullable) SDLRegisterAppInterfaceResponse *registerResponse; /** - * The auth token, if received. This should be used to log into a user account. + * The auth token, if received. This should be used to log into a user account. Primarily used for cloud apps with companion app stores. */ @property (strong, nonatomic, readonly, nullable) NSString *authToken; diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m index 19c9d8207..2e95ccf3c 100644 --- a/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink/SDLProtocol.m @@ -488,7 +488,7 @@ NS_ASSUME_NONNULL_BEGIN [SDLGlobals sharedGlobals].maxHeadUnitProtocolVersion = (startServiceACKPayload.protocolVersion != nil) ? [SDLVersion versionWithString:startServiceACKPayload.protocolVersion] : [SDLVersion versionWithMajor:startServiceACK.header.version minor:0 patch:0]; - self.authToken = [SDLGlobals.sharedGlobals.maxHeadUnitProtocolVersion isGreaterThanOrEqualVersion:[[SDLVersion alloc] initWithMajor:5 minor:2 patch:0]] ? startServiceACKPayload.authToken : nil; + self.authToken = [SDLGlobals.sharedGlobals.maxHeadUnitProtocolVersion isGreaterThanOrEqualToVersion:[[SDLVersion alloc] initWithMajor:5 minor:2 patch:0]] ? startServiceACKPayload.authToken : nil; // TODO: Hash id? } break; diff --git a/SmartDeviceLink/SDLVersion.h b/SmartDeviceLink/SDLVersion.h index debdd2630..02a4feb68 100644 --- a/SmartDeviceLink/SDLVersion.h +++ b/SmartDeviceLink/SDLVersion.h @@ -31,7 +31,8 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)isLessThanVersion:(SDLVersion *)otherVersion; - (BOOL)isEqualToVersion:(SDLVersion *)otherVersion; - (BOOL)isGreaterThanVersion:(SDLVersion *)otherVersion; -- (BOOL)isGreaterThanOrEqualVersion:(SDLVersion *)otherVersion; +- (BOOL)isGreaterThanOrEqualToVersion:(SDLVersion *)otherVersion; +- (BOOL)isLessThanOrEqualToVersion:(SDLVersion *)otherVersion; @end diff --git a/SmartDeviceLink/SDLVersion.m b/SmartDeviceLink/SDLVersion.m index 0e44d187a..0dd4173cb 100644 --- a/SmartDeviceLink/SDLVersion.m +++ b/SmartDeviceLink/SDLVersion.m @@ -110,10 +110,14 @@ NS_ASSUME_NONNULL_BEGIN return ([self compare:otherVersion] == NSOrderedDescending); } -- (BOOL)isGreaterThanOrEqualVersion:(SDLVersion *)otherVersion { +- (BOOL)isGreaterThanOrEqualToVersion:(SDLVersion *)otherVersion { return ([self isGreaterThanVersion:otherVersion] || [self isEqualToVersion:otherVersion]); } +- (BOOL)isLessThanOrEqualToVersion:(SDLVersion *)otherVersion { + return ([self isLessThanVersion:otherVersion] || [self isEqualToVersion:otherVersion]); +} + #pragma mark - NSObject overrides - (BOOL)isEqual:(id)object { diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLVersionSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLVersionSpec.m index 5e5ed662a..349f66f6d 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLVersionSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLVersionSpec.m @@ -92,6 +92,10 @@ describe(@"a version object", ^{ expect([testVersion isLessThanVersion:lowerVersion]).to(equal(NO)); expect([testVersion isLessThanVersion:equalVersion]).to(equal(NO)); expect([testVersion isLessThanVersion:higherVersion]).to(equal(YES)); + expect([testVersion isGreaterThanOrEqualToVersion:equalVersion]).to(equal(YES)); + expect([testVersion isGreaterThanOrEqualToVersion:lowerVersion]).to(equal(YES)); + expect([testVersion isLessThanOrEqualToVersion:equalVersion]).to(equal(YES)); + expect([testVersion isLessThanVersion:higherVersion]).to(equal(YES)); }); }); |