diff options
author | justingluck93 <47197545+justingluck93@users.noreply.github.com> | 2019-07-23 13:16:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 13:16:11 -0400 |
commit | c910eff048d483b14c24b87f9a8a9489a551849c (patch) | |
tree | 7194609939c8da706c7306cc212548be10a1bdb1 | |
parent | 5b21ce682c4cc96405ea0eeaef263c31e1d06061 (diff) | |
download | sdl_ios-c910eff048d483b14c24b87f9a8a9489a551849c.tar.gz |
Apply suggestions from code review
PR updates
Co-Authored-By: Joel Fischer <joeljfischer@gmail.com>
5 files changed, 14 insertions, 12 deletions
diff --git a/SmartDeviceLink/SDLAppServiceManifest.m b/SmartDeviceLink/SDLAppServiceManifest.m index 690e710c3..e7ab4e778 100644 --- a/SmartDeviceLink/SDLAppServiceManifest.m +++ b/SmartDeviceLink/SDLAppServiceManifest.m @@ -144,17 +144,18 @@ NS_ASSUME_NONNULL_BEGIN [self.store sdl_setObject:nil forName:SDLRPCParameterNameRPCSpecVersion]; return; } - SDLMsgVersion *maxRPCSpecVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)[rpcSpecVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[rpcSpecVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[rpcSpecVersion.patchVersion unsignedIntValue]]; + SDLMsgVersion *maxRPCSpecVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)rpcSpecVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)rpcSpecVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)rpcSpecVersion.patchVersion.unsignedIntValue]; [self.store sdl_setObject:maxRPCSpecVersion forName:SDLRPCParameterNameRPCSpecVersion]; } - (nullable SDLSyncMsgVersion *)rpcSpecVersion { - SDLMsgVersion * maxRPCSpecVersion = [self.store sdl_objectForName:SDLRPCParameterNameRPCSpecVersion ofClass:SDLMsgVersion.class error:nil]; + SDLMsgVersion *maxRPCSpecVersion = [self.store sdl_objectForName:SDLRPCParameterNameRPCSpecVersion ofClass:SDLMsgVersion.class error:nil]; if(maxRPCSpecVersion == nil) { return [self.store sdl_objectForName:SDLRPCParameterNameRPCSpecVersion ofClass:SDLSyncMsgVersion.class error:nil]; } - return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)[maxRPCSpecVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[maxRPCSpecVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[maxRPCSpecVersion.patchVersion unsignedIntValue]]; + + return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)maxRPCSpecVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)maxRPCSpecVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)maxRPCSpecVersion.patchVersion.unsignedIntValue]; } #pragma clang diagnostic pop diff --git a/SmartDeviceLink/SDLRegisterAppInterface.m b/SmartDeviceLink/SDLRegisterAppInterface.m index 5f0cc845f..6fa2ed638 100644 --- a/SmartDeviceLink/SDLRegisterAppInterface.m +++ b/SmartDeviceLink/SDLRegisterAppInterface.m @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN -@implementation SDLRegisterAppInterface +@implementation SDLRegisterAppInterface #pragma mark - Lifecycle @@ -123,13 +123,13 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)setSyncMsgVersion:(SDLSyncMsgVersion *)syncMsgVersion { - SDLMsgVersion * sdlMsgVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)[syncMsgVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[syncMsgVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[syncMsgVersion.patchVersion unsignedIntValue]]; + SDLMsgVersion * sdlMsgVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)syncMsgVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)syncMsgVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)syncMsgVersion.patchVersion.unsignedIntValue]; [self.parameters sdl_setObject:sdlMsgVersion forName:SDLRPCParameterNameSyncMessageVersion]; } - (SDLSyncMsgVersion *)syncMsgVersion { SDLMsgVersion * sdlMsgVersion = [self.parameters sdl_objectForName:SDLRPCParameterNameSyncMessageVersion ofClass:SDLMsgVersion.class error:nil]; - return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)[sdlMsgVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[sdlMsgVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[sdlMsgVersion.patchVersion unsignedIntValue]]; + return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)sdlMsgVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)sdlMsgVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)sdlMsgVersion.patchVersion.unsignedIntValue]; } #pragma clang diagnostic pop diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m index 8cfc26391..e1d174ecf 100644 --- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m +++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m @@ -36,18 +36,19 @@ NS_ASSUME_NONNULL_BEGIN [self.parameters sdl_setObject:nil forName:SDLRPCParameterNameSyncMessageVersion]; return; } - SDLMsgVersion * sdlMsgVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)[syncMsgVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[syncMsgVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[syncMsgVersion.patchVersion unsignedIntValue]]; + + SDLMsgVersion *sdlMsgVersion = [[SDLMsgVersion alloc] initWithMajorVersion:(uint8_t)syncMsgVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)syncMsgVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)syncMsgVersion.patchVersion.unsignedIntValue]; [self.parameters sdl_setObject:sdlMsgVersion forName:SDLRPCParameterNameSyncMessageVersion]; } - (nullable SDLSyncMsgVersion *)syncMsgVersion { - SDLMsgVersion * sdlMsgVersion = [self.parameters sdl_objectForName:SDLRPCParameterNameSyncMessageVersion ofClass:SDLMsgVersion.class error:nil]; + SDLMsgVersion *sdlMsgVersion = [self.parameters sdl_objectForName:SDLRPCParameterNameSyncMessageVersion ofClass:SDLMsgVersion.class error:nil]; if(sdlMsgVersion == nil) { return [self.parameters sdl_objectForName:SDLRPCParameterNameSyncMessageVersion ofClass:SDLSyncMsgVersion.class error:nil]; } - return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)[sdlMsgVersion.majorVersion unsignedIntValue] minorVersion:(uint8_t)[sdlMsgVersion.minorVersion unsignedIntValue] patchVersion:(uint8_t)[sdlMsgVersion.patchVersion unsignedIntValue]]; + return [[SDLSyncMsgVersion alloc] initWithMajorVersion:(uint8_t)sdlMsgVersion.majorVersion.unsignedIntValue minorVersion:(uint8_t)sdlMsgVersion.minorVersion.unsignedIntValue patchVersion:(uint8_t)sdlMsgVersion.patchVersion.unsignedIntValue]; } - (void)setSdlMsgVersion:(nullable SDLMsgVersion *)sdlMsgVersion { diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m index 1245d4600..7d03501a5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m @@ -114,7 +114,7 @@ describe(@"Getter/Setter Tests", ^ { it(@"Should get correctly when initialized with a dictionary and get syncMsgVersion first", ^ { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict]; + SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict]; #pragma clang diagnostic pop #pragma clang diagnostic push diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m index f530d0239..9096dc092 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m @@ -90,7 +90,7 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.mediaServiceManifest).to(equal(testMediaServiceManifest)); expect(testStruct.navigationServiceManifest).to(equal(testNavigationServiceManifest)); }); - describe(@"Test Dict", ^{ + describe(@"test initializing with dictionary", ^{ __block NSDictionary *dict = nil; beforeEach( ^{ dict = @{SDLRPCParameterNameServiceName:testServiceName, @@ -132,7 +132,7 @@ describe(@"Getter/Setter Tests", ^ { it(@"Should get correctly when initialized with a dictionary and using SDLMsgVersion", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithDictionary:dict]; + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithDictionary:dict]; #pragma clang diagnostic pop expect(testStruct.serviceName).to(match(testServiceName)); expect(testStruct.serviceType).to(equal(testServiceType)); |