summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Gluck <justin.gluck@livio.io>2019-04-08 15:47:47 -0400
committerJustin Gluck <justin.gluck@livio.io>2019-04-08 15:47:47 -0400
commita399900fff1632f80d00deac9f34cd1ec3facbbd (patch)
tree128a7d21175dd53fef40cbb2924de510d71c744e
parent0fcadd1638826b2e12996c3ebb506821b3780061 (diff)
downloadsdl_ios-a399900fff1632f80d00deac9f34cd1ec3facbbd.tar.gz
Fixed Pr issues
-rw-r--r--SmartDeviceLink/SDLError.h1
-rw-r--r--SmartDeviceLink/SDLError.m3
-rw-r--r--SmartDeviceLink/SDLPreloadChoicesOperation.m1
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m6
4 files changed, 4 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLError.h b/SmartDeviceLink/SDLError.h
index 70de061d2..cdc2bab41 100644
--- a/SmartDeviceLink/SDLError.h
+++ b/SmartDeviceLink/SDLError.h
@@ -69,7 +69,6 @@ extern SDLErrorDomain *const SDLErrorDomainRPCStore;
+ (NSError *)sdl_choiceSetManager_choiceUploadFailed:(NSDictionary *)userInfo;
+ (NSError *)sdl_choiceSetManager_failedToCreateMenuItems;
-
#pragma mark Transport
+ (NSError *)sdl_transport_unknownError;
diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m
index 909bbcef0..187940201 100644
--- a/SmartDeviceLink/SDLError.m
+++ b/SmartDeviceLink/SDLError.m
@@ -231,7 +231,8 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_choiceSetManager_failedToCreateMenuItems {
NSDictionary<NSString *, NSString *> *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(@"Choice Set Manager error", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"Choice set manager failed to create menu items do to menuName being empty.", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"Choice set manager failed to create menu items due to menuName being empty.", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"If you are setting the menuName, it is possible that the head unit is sending incorrect displayCapabilities.", nil)
};
return [NSError errorWithDomain:SDLErrorDomainChoiceSetManager code:SDLChoiceSetManagerErrorFailedToCreateMenuItems userInfo:userInfo];
}
diff --git a/SmartDeviceLink/SDLPreloadChoicesOperation.m b/SmartDeviceLink/SDLPreloadChoicesOperation.m
index e3fb78cd4..48ba11116 100644
--- a/SmartDeviceLink/SDLPreloadChoicesOperation.m
+++ b/SmartDeviceLink/SDLPreloadChoicesOperation.m
@@ -123,7 +123,6 @@ NS_ASSUME_NONNULL_BEGIN
[choiceRPCs addObject:csCell];
}
}
-
if (choiceRPCs.count == 0) {
SDLLogE(@"Error choiceRPCs is an empty array");
self.internalError = [NSError sdl_choiceSetManager_failedToCreateMenuItems];
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m
index bf289dc29..5bcf2d5de 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m
@@ -73,8 +73,8 @@ describe(@"a preload choices operation", ^{
cellsWithStaticIcon = [NSSet setWithArray:@[cellWithStaticIcon]];
});
- context(@"menueName is not set", ^{
- it(@"should return a nil object", ^{
+ context(@"if the menuName is not set", ^{
+ it(@"should not send any requests", ^{
SDLTextField *primaryTextField = [[SDLTextField alloc] init];
primaryTextField.name = SDLTextFieldNameMenuName;
displayCapabilities.textFields = @[];
@@ -182,7 +182,6 @@ describe(@"a preload choices operation", ^{
SDLChoiceCell *cellBasic = [[SDLChoiceCell alloc] initWithText:@"Cell1" artwork:nil voiceCommands:nil];
SDLChoiceCell *cellWithVR = [[SDLChoiceCell alloc] initWithText:@"Cell2" secondaryText:nil tertiaryText:nil voiceCommands:@[@"Cell2"] artwork:nil secondaryArtwork:nil];
SDLChoiceCell *cellWithAllText = [[SDLChoiceCell alloc] initWithText:@"Cell2" secondaryText:@"Cell2" tertiaryText:@"Cell2" voiceCommands:nil artwork:nil secondaryArtwork:nil];
-
cellsWithoutArtwork = [NSSet setWithArray:@[cellBasic, cellWithVR, cellWithAllText]];
});
@@ -192,7 +191,6 @@ describe(@"a preload choices operation", ^{
describe(@"assembling choices", ^{
it(@"should be correct with no text and VR required", ^{
-
testOp = [[SDLPreloadChoicesOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager displayCapabilities:displayCapabilities isVROptional:NO cellsToPreload:cellsWithoutArtwork];
[testOp start];
NSArray<SDLCreateInteractionChoiceSet *> *receivedRequests = (NSArray<SDLCreateInteractionChoiceSet *> *)testConnectionManager.receivedRequests;