diff options
author | Frank Elias <francois.elias@livio.io> | 2020-10-20 15:34:00 -0400 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2020-10-20 15:34:00 -0400 |
commit | 69f8ff1ebeefb5041b61399d82224ffe43ef6f75 (patch) | |
tree | 200ee7a9f8d1467baf58a734f58014c8ba34dd83 | |
parent | 7b9481fd7b868b0049ec2cfdf58b54fff650e7bf (diff) | |
download | sdl_ios-bugfix/issue-1813-some-properties-in-the-OnDriverDistraction-are-missing-nullable-attribute.tar.gz |
Comment reviewbugfix/issue-1813-some-properties-in-the-OnDriverDistraction-are-missing-nullable-attribute
Comment review
-rw-r--r-- | SmartDeviceLink/public/SDLOnDriverDistraction.m | 8 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m | 14 |
2 files changed, 8 insertions, 14 deletions
diff --git a/SmartDeviceLink/public/SDLOnDriverDistraction.m b/SmartDeviceLink/public/SDLOnDriverDistraction.m index 0ac162913..4d949ffb7 100644 --- a/SmartDeviceLink/public/SDLOnDriverDistraction.m +++ b/SmartDeviceLink/public/SDLOnDriverDistraction.m @@ -30,20 +30,20 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_enumForName:SDLRPCParameterNameState error:&error]; } -- (void)setLockScreenDismissalEnabled:(NSNumber<SDLBool> *_Nullable)lockScreenDismissalEnabled { +- (void)setLockScreenDismissalEnabled:(nullable NSNumber<SDLBool> *)lockScreenDismissalEnabled { [self.parameters sdl_setObject:lockScreenDismissalEnabled forName:SDLRPCParameterNameLockScreenDismissalEnabled]; } -- (NSNumber<SDLBool> *_Nullable)lockScreenDismissalEnabled { +- (nullable NSNumber<SDLBool> *)lockScreenDismissalEnabled { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalEnabled ofClass:NSNumber.class error:&error]; } -- (void)setLockScreenDismissalWarning:(NSString *_Nullable)lockScreenDismissalWarning { +- (void)setLockScreenDismissalWarning:(nullable NSString *)lockScreenDismissalWarning { [self.parameters sdl_setObject:lockScreenDismissalWarning forName:SDLRPCParameterNameLockScreenDismissalWarning]; } -- (NSString *_Nullable)lockScreenDismissalWarning { +- (nullable NSString *)lockScreenDismissalWarning { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalWarning ofClass:NSString.class error:&error]; } diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m index 9d519d4a7..33836f9fb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m @@ -28,21 +28,15 @@ describe(@"Getter/Setter Tests", ^ { expect(testNotification.state).to(equal(SDLDriverDistractionStateOn)); expect(testNotification.lockScreenDismissalEnabled).to(beTrue()); expect(testNotification.lockScreenDismissalWarning).to(equal(testDismissalWarning)); - - testNotification.lockScreenDismissalEnabled = @0; - expect(testNotification.lockScreenDismissalEnabled).to(beFalse()); - - testNotification.lockScreenDismissalWarning = nil; - expect(testNotification.lockScreenDismissalWarning).to(beNil()); }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary *dictOn = [@{SDLRPCParameterNameNotification: + NSDictionary *dictOn = @{SDLRPCParameterNameNotification: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameState:SDLDriverDistractionStateOn, SDLRPCParameterNameLockScreenDismissalEnabled: @1, SDLRPCParameterNameLockScreenDismissalWarning: testDismissalWarning}, - SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}}; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLOnDriverDistraction* testNotificationOn = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOn]; @@ -52,11 +46,11 @@ describe(@"Getter/Setter Tests", ^ { expect(testNotificationOn.lockScreenDismissalEnabled).to(beTrue()); expect(testNotificationOn.lockScreenDismissalWarning).to(equal(testDismissalWarning)); - NSMutableDictionary *dictOff = [@{SDLRPCParameterNameNotification: + NSDictionary *dictOff = @{SDLRPCParameterNameNotification: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameState:SDLDriverDistractionStateOff, SDLRPCParameterNameLockScreenDismissalEnabled: @0}, - SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}}; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLOnDriverDistraction *testNotificationOff = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOff]; |