summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Gluck <justin.gluck@livio.io>2019-04-05 11:53:13 -0400
committerJustin Gluck <justin.gluck@livio.io>2019-04-05 11:53:13 -0400
commit3a9950d280c7f88ffd085381749d7a48c60c1326 (patch)
treeb31dc8e8d7f0921b0e82a140628fdba3406a5656
parent851f58e740d07393fdadb320e3778f138c2b5a0f (diff)
downloadsdl_ios-3a9950d280c7f88ffd085381749d7a48c60c1326.tar.gz
Removing class check and fixed test casebugfix/issue-1097-Add-Missing-ProtocolViolationCheck
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m4
2 files changed, 3 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 02ddfeb84..23eebd272 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -789,7 +789,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
[self sdl_transitionToState:SDLLifecycleStateStopped];
} else if ([self.lifecycleStateMachine isCurrentState:SDLLifecycleStateStopped]) {
return;
- } else if ([appUnregisteredNotification.reason isKindOfClass:[NSString class]] && ([appUnregisteredNotification.reason isEqualToEnum:SDLAppInterfaceUnregisteredReasonAppUnauthorized] || [appUnregisteredNotification.reason isEqualToString:SDLAppInterfaceUnregisteredReasonProtocolViolation])) {
+ } else if (appUnregisteredNotification.reason != nil && ([appUnregisteredNotification.reason isEqualToEnum:SDLAppInterfaceUnregisteredReasonAppUnauthorized] || [appUnregisteredNotification.reason isEqualToString:SDLAppInterfaceUnregisteredReasonProtocolViolation])) {
// HAX: The string check is due to a core "feature" that could cause -1 to be sent as the enum value, which will crash here.
[self sdl_transitionToState:SDLLifecycleStateStopped];
} else {
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
index 1c326b2a7..0385898d2 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
@@ -525,7 +525,7 @@ describe(@"a lifecycle manager", ^{
SDLRPCNotificationNotification *notification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveAppUnregisteredNotification object:testManager.notificationDispatcher rpcNotification:unreg];
[[NSNotificationCenter defaultCenter] postNotification:notification];
- expect(testManager.lifecycleState).toEventually(match(SDLLifecycleStateStopped));
+ expect(testManager.lifecycleState).toEventually(equal(SDLLifecycleStateStopped));
});
it(@"should attempt to stop the manager when an APP_UNAUTHORIZED notification is recieved", ^{
@@ -536,7 +536,7 @@ describe(@"a lifecycle manager", ^{
SDLRPCNotificationNotification *notification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveAppUnregisteredNotification object:testManager.notificationDispatcher rpcNotification:unreg];
[[NSNotificationCenter defaultCenter] postNotification:notification];
- expect(testManager.lifecycleState).toEventually(match(SDLLifecycleStateStopped));
+ expect(testManager.lifecycleState).toEventually(equal(SDLLifecycleStateStopped));
});
});