diff options
author | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-04 18:55:50 +0300 |
---|---|---|
committer | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-04 18:55:50 +0300 |
commit | f30354816a8a728d488b492296c012d232c10365 (patch) | |
tree | e990cb6c658d15b5f6da9c16b5b48b6e7880c6b0 | |
parent | 20b2f6ff91682ddbfbdad51b37fa766e053f2d22 (diff) | |
download | sdl_ios-f30354816a8a728d488b492296c012d232c10365.tar.gz |
sdl-0253 "New vehicle data StabilityControlsStatus": code review, fix SDLStabilityControlsStatus
-rw-r--r-- | SmartDeviceLink/SDLStabilityControlsStatus.m | 6 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStabilityControlsStatusSpec.m | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLStabilityControlsStatus.m b/SmartDeviceLink/SDLStabilityControlsStatus.m index 0748fe3f7..b74b9e129 100644 --- a/SmartDeviceLink/SDLStabilityControlsStatus.m +++ b/SmartDeviceLink/SDLStabilityControlsStatus.m @@ -54,7 +54,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataStatus)escSystem { - return [self.store sdl_enumForName:SDLRPCParameterNameEscSystem error:nil]; + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameEscSystem error:&error]; } - (void)setTrailerSwayControl:(nullable SDLVehicleDataStatus)trailerSwayControl { @@ -62,7 +63,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataStatus)trailerSwayControl { - return [self.store sdl_enumForName:SDLRPCParameterNameTrailerSwayControl error:nil]; + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameTrailerSwayControl error:&error]; } @end diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStabilityControlsStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStabilityControlsStatusSpec.m index 6a484df4e..e3a2d8c44 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStabilityControlsStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStabilityControlsStatusSpec.m @@ -58,6 +58,14 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.escSystem).to(beNil()); expect(testStruct.trailerSwayControl).to(beNil()); }); + + context(@"initWithEscSystem:trailerSwayControl:", ^{ + SDLStabilityControlsStatus* testStruct = [[SDLStabilityControlsStatus alloc] initWithEscSystem:SDLVehicleDataStatusOff trailerSwayControl:SDLVehicleDataStatusOff]; + it(@"Expect all properties to be set properly", ^ { + expect(testStruct.escSystem).to(equal(SDLVehicleDataStatusOff)); + expect(testStruct.trailerSwayControl).to(equal(SDLVehicleDataStatusOff)); + }); + }); }); QuickSpecEnd |