diff options
author | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-07-06 21:23:59 +0300 |
---|---|---|
committer | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-07-06 21:45:38 +0300 |
commit | 7c2dbcfa945d3b9d570a8253c5b7f9977ca68cc0 (patch) | |
tree | 807c1b337a2d159be6a519f9a6757d8b85910928 | |
parent | cc098e1084cc1f38f62bab2c1eeba1546b1a220f (diff) | |
download | sdl_ios-7c2dbcfa945d3b9d570a8253c5b7f9977ca68cc0.tar.gz |
sdl-0266 "New vehicle data GearStatus": apply review comments use [[x alloc] init] instead of [x new]; replace (nullable, strong, nonatomic) with (strong, nonatomic, nullable);
replace .to(beFalse()); with .to(equal(@NO)); in tests
replace .to(beTrue()); with .to(equal(@YES)); in tests
reorder headers import alphabetically
15 files changed, 89 insertions, 60 deletions
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index 3c591e152..ac0d9f7a8 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -133,6 +133,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLFuelRange.h', 'SmartDeviceLink/SDLFuelType.h', 'SmartDeviceLink/SDLFunctionID.h', +'SmartDeviceLink/SDLGearStatus.h', 'SmartDeviceLink/SDLGenericResponse.h', 'SmartDeviceLink/SDLGetCloudAppProperties.h', 'SmartDeviceLink/SDLGetCloudAppPropertiesResponse.h', @@ -405,6 +406,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLTouchManagerDelegate.h', 'SmartDeviceLink/SDLTouchType.h', 'SmartDeviceLink/SDLTPMS.h', +'SmartDeviceLink/SDLTransmissionType.h', 'SmartDeviceLink/SDLTriggerSource.h', 'SmartDeviceLink/SDLTTSChunk.h', 'SmartDeviceLink/SDLTurn.h', diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec index a525183f5..1d856c9ab 100644 --- a/SmartDeviceLink.podspec +++ b/SmartDeviceLink.podspec @@ -134,6 +134,7 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLFuelRange.h', 'SmartDeviceLink/SDLFuelType.h', 'SmartDeviceLink/SDLFunctionID.h', +'SmartDeviceLink/SDLGearStatus.h', 'SmartDeviceLink/SDLGenericResponse.h', 'SmartDeviceLink/SDLGetAppServiceData.h', 'SmartDeviceLink/SDLGetAppServiceDataResponse.h', @@ -406,6 +407,7 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLTouchManagerDelegate.h', 'SmartDeviceLink/SDLTouchType.h', 'SmartDeviceLink/SDLTPMS.h', +'SmartDeviceLink/SDLTransmissionType.h', 'SmartDeviceLink/SDLTriggerSource.h', 'SmartDeviceLink/SDLTTSChunk.h', 'SmartDeviceLink/SDLTurn.h', diff --git a/SmartDeviceLink/SDLGearStatus.h b/SmartDeviceLink/SDLGearStatus.h index 4e02874bc..de6bc9c68 100644 --- a/SmartDeviceLink/SDLGearStatus.h +++ b/SmartDeviceLink/SDLGearStatus.h @@ -51,16 +51,22 @@ NS_ASSUME_NONNULL_BEGIN /** * Gear position selected by the user i.e. Park, Drive, Reverse + * + * Optional. */ @property (nullable, strong, nonatomic) SDLPRNDL userSelectedGear; /** * Actual Gear in use by the transmission + * + * Optional. */ @property (nullable, strong, nonatomic) SDLPRNDL actualGear; /** * Tells the transmission type + * + * Optional. */ @property (nullable, strong, nonatomic) SDLTransmissionType transmissionType; diff --git a/SmartDeviceLink/SDLGearStatus.m b/SmartDeviceLink/SDLGearStatus.m index 04ac69436..f2d11c4f4 100644 --- a/SmartDeviceLink/SDLGearStatus.m +++ b/SmartDeviceLink/SDLGearStatus.m @@ -30,11 +30,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#import "SDLGearStatus.h" #import "NSMutableDictionary+Store.h" +#import "SDLGearStatus.h" #import "SDLPRNDL.h" -#import "SDLTransmissionType.h" #import "SDLRPCParameterNames.h" +#import "SDLTransmissionType.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index b21e0808d..b1d7bdf2b 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -46,6 +46,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameAccelerationPedalPosition; extern SDLRPCParameterName const SDLRPCParameterNameAcceptsWayPoints; extern SDLRPCParameterName const SDLRPCParameterNameAction; extern SDLRPCParameterName const SDLRPCParameterNameActual; +extern SDLRPCParameterName const SDLRPCParameterNameActualGear; extern SDLRPCParameterName const SDLRPCParameterNameAddress; extern SDLRPCParameterName const SDLRPCParameterNameAddressLines; extern SDLRPCParameterName const SDLRPCParameterNameAdministrativeArea; @@ -254,6 +255,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameFullAppID; extern SDLRPCParameterName const SDLRPCParameterNameFunctionID; extern SDLRPCParameterName const SDLRPCParameterNameGetWayPointsEnabled; extern SDLRPCParameterName const SDLRPCParameterNameGPS; +extern SDLRPCParameterName const SDLRPCParameterNameGearStatus; extern SDLRPCParameterName const SDLRPCParameterNameGraphic; extern SDLRPCParameterName const SDLRPCParameterNameGraphicSupported; extern SDLRPCParameterName const SDLRPCParameterNameGreen; @@ -687,6 +689,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameTotalDistance; extern SDLRPCParameterName const SDLRPCParameterNameTouchEventAvailable; extern SDLRPCParameterName const SDLRPCParameterNameTPMS; extern SDLRPCParameterName const SDLRPCParameterNameTrafficProgramIdentification; +extern SDLRPCParameterName const SDLRPCParameterNameTransmissionType; extern SDLRPCParameterName const SDLRPCParameterNameTriggerSource; extern SDLRPCParameterName const SDLRPCParameterNameTrim; extern SDLRPCParameterName const SDLRPCParameterNameTryAgainTime; @@ -707,6 +710,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameURLUppercase; extern SDLRPCParameterName const SDLRPCParameterNameUserDisallowed; extern SDLRPCParameterName const SDLRPCParameterNameUserLocation; extern SDLRPCParameterName const SDLRPCParameterNameUserSelected; +extern SDLRPCParameterName const SDLRPCParameterNameUserSelectedGear; extern SDLRPCParameterName const SDLRPCParameterNameUTCDay; extern SDLRPCParameterName const SDLRPCParameterNameUTCHours; extern SDLRPCParameterName const SDLRPCParameterNameUTCMinutes; @@ -754,9 +758,5 @@ extern SDLRPCParameterName const SDLRPCParameterNameWindowTypeSupported; extern SDLRPCParameterName const SDLRPCParameterNameX; extern SDLRPCParameterName const SDLRPCParameterNameY; extern SDLRPCParameterName const SDLRPCParameterNameYear; -extern SDLRPCParameterName const SDLRPCParameterNameActualGear; -extern SDLRPCParameterName const SDLRPCParameterNameGearStatus; -extern SDLRPCParameterName const SDLRPCParameterNameUserSelectedGear; -extern SDLRPCParameterName const SDLRPCParameterNameTransmissionType; NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 0c5622465..9f054cec5 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -44,6 +44,7 @@ SDLRPCParameterName const SDLRPCParameterNameAccelerationPedalPosition = @"accPe SDLRPCParameterName const SDLRPCParameterNameAcceptsWayPoints = @"acceptsWayPoints"; SDLRPCParameterName const SDLRPCParameterNameAction = @"action"; SDLRPCParameterName const SDLRPCParameterNameActual = @"actual"; +SDLRPCParameterName const SDLRPCParameterNameActualGear = @"actualGear"; SDLRPCParameterName const SDLRPCParameterNameAddress = @"address"; SDLRPCParameterName const SDLRPCParameterNameAddressLines = @"addressLines"; SDLRPCParameterName const SDLRPCParameterNameAdministrativeArea = @"administrativeArea"; @@ -248,6 +249,7 @@ SDLRPCParameterName const SDLRPCParameterNameFuelMaintenanceMode = @"fuelMainten SDLRPCParameterName const SDLRPCParameterNameFuelRange = @"fuelRange"; SDLRPCParameterName const SDLRPCParameterNameFunctionID = @"functionID"; SDLRPCParameterName const SDLRPCParameterNameFullAppID = @"fullAppID"; +SDLRPCParameterName const SDLRPCParameterNameGearStatus = @"gearStatus"; SDLRPCParameterName const SDLRPCParameterNameGetWayPointsEnabled = @"getWayPointsEnabled"; SDLRPCParameterName const SDLRPCParameterNameGPS = @"gps"; SDLRPCParameterName const SDLRPCParameterNameGraphic = @"graphic"; @@ -682,6 +684,7 @@ SDLRPCParameterName const SDLRPCParameterNameTotalDistance = @"totalDistance"; SDLRPCParameterName const SDLRPCParameterNameTouchEventAvailable = @"touchEventAvailable"; SDLRPCParameterName const SDLRPCParameterNameTPMS = @"tpms"; SDLRPCParameterName const SDLRPCParameterNameTrafficProgramIdentification = @"TP"; +SDLRPCParameterName const SDLRPCParameterNameTransmissionType = @"transmissionType"; SDLRPCParameterName const SDLRPCParameterNameTriggerSource = @"triggerSource"; SDLRPCParameterName const SDLRPCParameterNameTrim = @"trim"; SDLRPCParameterName const SDLRPCParameterNameTryAgainTime = @"tryAgainTime"; @@ -702,6 +705,7 @@ SDLRPCParameterName const SDLRPCParameterNameURLUppercase = @"URL"; SDLRPCParameterName const SDLRPCParameterNameUserDisallowed = @"userDisallowed"; SDLRPCParameterName const SDLRPCParameterNameUserLocation = @"userLocation"; SDLRPCParameterName const SDLRPCParameterNameUserSelected = @"userSelected"; +SDLRPCParameterName const SDLRPCParameterNameUserSelectedGear = @"userSelectedGear"; SDLRPCParameterName const SDLRPCParameterNameUTCDay = @"utcDay"; SDLRPCParameterName const SDLRPCParameterNameUTCHours = @"utcHours"; SDLRPCParameterName const SDLRPCParameterNameUTCMinutes = @"utcMinutes"; @@ -749,9 +753,5 @@ SDLRPCParameterName const SDLRPCParameterNameWindowTypeSupported = @"windowTypeS SDLRPCParameterName const SDLRPCParameterNameX = @"x"; SDLRPCParameterName const SDLRPCParameterNameY = @"y"; SDLRPCParameterName const SDLRPCParameterNameYear = @"year"; -SDLRPCParameterName const SDLRPCParameterNameActualGear = @"actualGear"; -SDLRPCParameterName const SDLRPCParameterNameGearStatus = @"gearStatus"; -SDLRPCParameterName const SDLRPCParameterNameUserSelectedGear = @"userSelectedGear"; -SDLRPCParameterName const SDLRPCParameterNameTransmissionType = @"transmissionType"; NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index c94f0c7c1..695b5dd73 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -202,6 +202,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLEmergencyEvent.h" #import "SDLFuelRange.h" #import "SDLEqualizerSettings.h" +#import "SDLGearStatus.h" #import "SDLGPSData.h" #import "SDLGrid.h" #import "SDLHapticRect.h" @@ -268,6 +269,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLTouchCoord.h" #import "SDLTouchEvent.h" #import "SDLTouchEventCapabilities.h" +#import "SDLTransmissionType.h" #import "SDLTurn.h" #import "SDLVehicleDataResult.h" #import "SDLVehicleType.h" @@ -280,8 +282,6 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLWeatherServiceManifest.h" #import "SDLWindowCapability.h" #import "SDLWindowTypeCapabilities.h" -#import "SDLGearStatus.h" -#import "SDLTransmissionType.h" // Enums #import "SDLAmbientLightStatus.h" diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m index fc400ba01..b79d5d944 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m @@ -4,14 +4,13 @@ #import <Foundation/Foundation.h> - -#import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import <Quick/Quick.h> -#import "SmartDeviceLink.h" -#import "SDLRPCParameterNames.h" -#import "SDLRPCFunctionNames.h" #import "SDLGearStatus.h" +#import "SDLRPCFunctionNames.h" +#import "SDLRPCParameterNames.h" +#import "SmartDeviceLink.h" QuickSpecBegin(SDLOnVehicleDataSpec) @@ -46,7 +45,7 @@ describe(@"Getter/Setter Tests", ^ { myKey = [[SDLMyKey alloc] init]; fuelRange = [[SDLFuelRange alloc] init]; cloudAppVehicleID = @"testCloudAppVehicleID"; - gearStatus = [SDLGearStatus new]; + gearStatus = [[SDLGearStatus alloc] init]; }); it(@"should correctly initialize with init", ^ { @@ -74,7 +73,10 @@ describe(@"Getter/Setter Tests", ^ { testNotification.instantFuelConsumption = @4000.63; testNotification.myKey = myKey; testNotification.odometer = @100050; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testNotification.prndl = SDLPRNDLDrive; +#pragma clang diagnostic pop testNotification.gearStatus = gearStatus; testNotification.rpm = @4242; testNotification.speed = @70.1; @@ -106,7 +108,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testNotification.instantFuelConsumption).to(equal(@4000.63)); expect(testNotification.myKey).to(equal(myKey)); expect(testNotification.odometer).to(equal(@100050)); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testNotification.prndl).to(equal(SDLPRNDLDrive)); +#pragma clang diagnostic pop expect(testNotification.gearStatus).to(equal(gearStatus)); expect(testNotification.rpm).to(equal(@4242)); expect(testNotification.speed).to(equal(@70.1)); @@ -143,7 +148,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameMyKey:myKey, SDLRPCParameterNameOdometer:@100050, SDLRPCParameterNamePRNDL:SDLPRNDLDrive, - @"gearStatus":gearStatus, + SDLRPCParameterNameGearStatus:gearStatus, SDLRPCParameterNameRPM:@4242, SDLRPCParameterNameSpeed:@70.1, SDLRPCParameterNameSteeringWheelAngle:@0.000000001, @@ -179,7 +184,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testNotification.instantFuelConsumption).to(equal(@4000.63)); expect(testNotification.myKey).to(equal(myKey)); expect(testNotification.odometer).to(equal(@100050)); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testNotification.prndl).to(equal(SDLPRNDLDrive)); +#pragma clang diagnostic pop expect(testNotification.gearStatus).to(equal(gearStatus)); expect(testNotification.rpm).to(equal(@4242)); expect(testNotification.speed).to(equal(@70.1)); @@ -215,7 +223,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testNotification.instantFuelConsumption).to(beNil()); expect(testNotification.myKey).to(beNil()); expect(testNotification.odometer).to(beNil()); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testNotification.prndl).to(beNil()); +#pragma clang diagnostic pop expect(testNotification.gearStatus).to(beNil()); expect(testNotification.rpm).to(beNil()); expect(testNotification.speed).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m index 6a25c2597..b203985db 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m @@ -4,19 +4,18 @@ #import <Foundation/Foundation.h> - -#import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import <Quick/Quick.h> #import "SDLGetVehicleData.h" -#import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLGetVehicleDataSpec) describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { - SDLGetVehicleData* testRequest = [SDLGetVehicleData new]; + SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init]; testRequest.accPedalPosition = @YES; testRequest.airbagStatus = @NO; @@ -119,7 +118,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTirePressure:@YES, SDLRPCParameterNameTurnSignal:@NO, SDLRPCParameterNameWiperStatus:@YES, - @"gearStatus":@YES + SDLRPCParameterNameGearStatus:@YES }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}}; #pragma clang diagnostic push @@ -165,7 +164,7 @@ describe(@"Getter/Setter Tests", ^ { describe(@"initializers", ^{ context(@"init", ^{ - SDLGetVehicleData* testRequest = [SDLGetVehicleData new]; + SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init]; expect(testRequest.accPedalPosition).to(beNil()); expect(testRequest.airbagStatus).to(beNil()); @@ -330,8 +329,8 @@ describe(@"initializers", ^{ [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData" withVehicleDataState:NO]; [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData1" withVehicleDataState:YES]; - expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData"]).to(beFalse()); - expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData1"]).to(beTrue()); + expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData"]).to(equal(@NO)); + expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData1"]).to(equal(@YES)); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m index bfe5dc764..4b758db1e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m @@ -4,19 +4,18 @@ #import <Foundation/Foundation.h> - -#import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import <Quick/Quick.h> -#import "SDLSubscribeVehicleData.h" -#import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLSubscribeVehicleData.h" QuickSpecBegin(SDLSubscribeVehicleDataSpec) describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { - SDLSubscribeVehicleData* testRequest = [SDLSubscribeVehicleData new]; + SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] init]; testRequest.accPedalPosition = @YES; testRequest.airbagStatus = @NO; @@ -119,7 +118,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTirePressure:@YES, SDLRPCParameterNameTurnSignal:@NO, SDLRPCParameterNameWiperStatus:@NO, - @"gearStatus":@YES + SDLRPCParameterNameGearStatus:@YES }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}}; #pragma clang diagnostic push @@ -165,7 +164,7 @@ describe(@"Getter/Setter Tests", ^ { describe(@"initializers", ^{ context(@"init", ^{ - SDLSubscribeVehicleData* testRequest = [SDLSubscribeVehicleData new]; + SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] init]; expect(testRequest.accPedalPosition).to(beNil()); expect(testRequest.airbagStatus).to(beNil()); @@ -309,7 +308,7 @@ describe(@"initializers", ^{ expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beTrue()); + expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.gearStatus).to(beNil()); expect(testRequest.rpm).to(equal(@YES)); @@ -327,8 +326,8 @@ describe(@"initializers", ^{ [testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:NO]; [testRequest setOEMCustomVehicleData:@"customVehicleData1" withVehicleDataState:YES]; - expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(beFalse()); - expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(beTrue()); + expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@NO)); + expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(equal(@YES)); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m index 36938e4a2..3725a95e4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m @@ -4,19 +4,18 @@ #import <Foundation/Foundation.h> - -#import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import <Quick/Quick.h> -#import "SDLUnsubscribeVehicleData.h" -#import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLUnsubscribeVehicleData.h" QuickSpecBegin(SDLUnsubscribeVehicleDataSpec) describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { - SDLUnsubscribeVehicleData* testRequest = [SDLUnsubscribeVehicleData new]; + SDLUnsubscribeVehicleData* testRequest = [[SDLUnsubscribeVehicleData alloc] init]; testRequest.accPedalPosition = @YES; testRequest.airbagStatus = @YES; @@ -119,7 +118,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTirePressure:@YES, SDLRPCParameterNameTurnSignal:@YES, SDLRPCParameterNameWiperStatus:@YES, - @"gearStatus":@YES + SDLRPCParameterNameGearStatus:@YES }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; #pragma clang diagnostic push @@ -275,7 +274,7 @@ describe(@"initializers", ^{ expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beTrue()); + expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.gearStatus).to(beNil()); expect(testRequest.rpm).to(equal(@YES)); @@ -318,7 +317,7 @@ describe(@"initializers", ^{ expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beTrue()); + expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.gearStatus).to(beNil()); expect(testRequest.rpm).to(equal(@YES)); @@ -335,8 +334,8 @@ describe(@"initializers", ^{ [testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:NO]; [testRequest setOEMCustomVehicleData:@"customVehicleData1" withVehicleDataState:YES]; it(@"all set", ^{ - expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(beFalse()); - expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(beTrue()); + expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@NO)); + expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(equal(@YES)); }); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m index 6757517a8..f198c682a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m @@ -4,14 +4,13 @@ #import <Foundation/Foundation.h> - -#import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import <Quick/Quick.h> -#import "SmartDeviceLink.h" +#import "SDLGearStatus.h" #import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" -#import "SDLGearStatus.h" +#import "SmartDeviceLink.h" QuickSpecBegin(SDLGetVehicleDataResponseSpec) @@ -48,11 +47,11 @@ describe(@"Getter/Setter Tests", ^ { fuelRange = [[SDLFuelRange alloc] init]; vin = @"6574839201a"; cloudAppVehicleID = @"cloudAppVehicleID"; - gearStatus = [SDLGearStatus new]; + gearStatus = [[SDLGearStatus alloc] init]; }); it(@"Should set and get correctly", ^ { - SDLGetVehicleDataResponse* testResponse = [SDLGetVehicleDataResponse new]; + SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init]; testResponse.accPedalPosition = @0; testResponse.airbagStatus = airbag; @@ -159,7 +158,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTurnSignal:SDLTurnSignalOff, SDLRPCParameterNameVIN:vin, SDLRPCParameterNameWiperStatus:SDLWiperStatusAutomaticHigh, - @"gearStatus":gearStatus + SDLRPCParameterNameGearStatus:gearStatus }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}}; #pragma clang diagnostic push diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m index 3bacb2e5d..c5da55b3e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m @@ -120,7 +120,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTirePressure:vehicleDataResult, SDLRPCParameterNameTurnSignal:vehicleDataResult, SDLRPCParameterNameWiperStatus:vehicleDataResult, - @"gearStatus":vehicleDataResult + SDLRPCParameterNameGearStatus:vehicleDataResult }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}}; #pragma clang diagnostic push diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m index 77de06871..7aa0506d0 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m @@ -31,7 +31,10 @@ describe(@"Getter/Setter Tests", ^ { testResponse.fuelRange = vehicleDataResult; testResponse.instantFuelConsumption = vehicleDataResult; testResponse.externalTemperature = vehicleDataResult; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testResponse.prndl = vehicleDataResult; +#pragma clang diagnostic pop testResponse.gearStatus = vehicleDataResult; testResponse.tirePressure = vehicleDataResult; testResponse.odometer = vehicleDataResult; @@ -62,7 +65,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testResponse.fuelRange).to(equal(vehicleDataResult)); expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testResponse.prndl).to(equal(vehicleDataResult)); +#pragma clang diagnostic pop expect(testResponse.gearStatus).to(equal(vehicleDataResult)); expect(testResponse.tirePressure).to(equal(vehicleDataResult)); expect(testResponse.odometer).to(equal(vehicleDataResult)); @@ -118,7 +124,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult, SDLRPCParameterNameTurnSignal:vehicleDataResult, SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult, - @"gearStatus":vehicleDataResult + SDLRPCParameterNameGearStatus:vehicleDataResult }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; #pragma clang diagnostic push @@ -134,7 +140,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testResponse.fuelRange).to(equal(vehicleDataResult)); expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testResponse.prndl).to(equal(vehicleDataResult)); +#pragma clang diagnostic pop expect(testResponse.gearStatus).to(equal(vehicleDataResult)); expect(testResponse.tirePressure).to(equal(vehicleDataResult)); expect(testResponse.odometer).to(equal(vehicleDataResult)); @@ -169,7 +178,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testResponse.fuelRange).to(beNil()); expect(testResponse.instantFuelConsumption).to(beNil()); expect(testResponse.externalTemperature).to(beNil()); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testResponse.prndl).to(beNil()); +#pragma clang diagnostic pop expect(testResponse.gearStatus).to(beNil()); expect(testResponse.tirePressure).to(beNil()); expect(testResponse.odometer).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGearStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGearStatusSpec.m index c23de9ec2..b0af609ce 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGearStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGearStatusSpec.m @@ -20,9 +20,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{@"userSelectedGear":SDLPRNDLNinth, - @"actualGear":SDLPRNDLTenth, - @"transmissionType":SDLTransmissionTypeAutomatic}; + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameUserSelectedGear:SDLPRNDLNinth, + SDLRPCParameterNameActualGear:SDLPRNDLTenth, + SDLRPCParameterNameTransmissionType:SDLTransmissionTypeAutomatic}; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLGearStatus* testStruct = [[SDLGearStatus alloc] initWithDictionary:dict]; @@ -34,7 +34,7 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should return nil if not set", ^ { - SDLGearStatus* testStruct = [SDLGearStatus new]; + SDLGearStatus* testStruct = [[SDLGearStatus alloc] init]; expect(testStruct.userSelectedGear).to(beNil()); expect(testStruct.actualGear).to(beNil()); |