summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2016-11-03 10:11:58 -0700
committerMuller, Alexander (A.) <amulle19@ford.com>2016-11-03 10:11:58 -0700
commitbff6775d44cd1c480b20f880b0b277c7d0d461f8 (patch)
treee44f40a920da3dc3269aecf299a8fdb5e2e6f5e0
parente7845f4bf9ddeb0fe8a4a2b42d25a88d6ae7429a (diff)
downloadsdl_ios-bff6775d44cd1c480b20f880b0b277c7d0d461f8.tar.gz
Added support for generic SDLDisplayType.
-rw-r--r--SmartDeviceLink/SDLDisplayType.h2
-rw-r--r--SmartDeviceLink/SDLDisplayType.m9
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDisplayTypeSpec.m10
3 files changed, 16 insertions, 5 deletions
diff --git a/SmartDeviceLink/SDLDisplayType.h b/SmartDeviceLink/SDLDisplayType.h
index 3bb2f2b9a..a25590ecb 100644
--- a/SmartDeviceLink/SDLDisplayType.h
+++ b/SmartDeviceLink/SDLDisplayType.h
@@ -58,4 +58,6 @@
+ (SDLDisplayType *)GEN3_8_INCH;
++ (SDLDisplayType *)GENERIC;
+
@end
diff --git a/SmartDeviceLink/SDLDisplayType.m b/SmartDeviceLink/SDLDisplayType.m
index 8059aa54b..0c44413c0 100644
--- a/SmartDeviceLink/SDLDisplayType.m
+++ b/SmartDeviceLink/SDLDisplayType.m
@@ -14,6 +14,7 @@ SDLDisplayType *SDLDisplayType_MFD3 = nil;
SDLDisplayType *SDLDisplayType_MFD4 = nil;
SDLDisplayType *SDLDisplayType_MFD5 = nil;
SDLDisplayType *SDLDisplayType_GEN3_8_INCH = nil;
+SDLDisplayType *SDLDisplayType_GENERIC = nil;
NSArray *SDLDisplayType_values = nil;
@@ -41,6 +42,7 @@ NSArray *SDLDisplayType_values = nil;
SDLDisplayType.MFD4,
SDLDisplayType.MFD5,
SDLDisplayType.GEN3_8_INCH,
+ SDLDisplayType.GENERIC
];
}
return SDLDisplayType_values;
@@ -116,4 +118,11 @@ NSArray *SDLDisplayType_values = nil;
return SDLDisplayType_GEN3_8_INCH;
}
++ (SDLDisplayType *)GENERIC {
+ if (SDLDisplayType_GENERIC == nil) {
+ SDLDisplayType_GENERIC = [[SDLDisplayType alloc] initWithValue:@"SDL_GENERIC"];
+ }
+ return SDLDisplayType_GENERIC;
+}
+
@end
diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDisplayTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDisplayTypeSpec.m
index 964736fbc..eaa44c2d3 100644
--- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDisplayTypeSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDisplayTypeSpec.m
@@ -23,8 +23,8 @@ describe(@"Individual Enum Value Tests", ^ {
expect([SDLDisplayType MFD3].value).to(equal(@"MFD3"));
expect([SDLDisplayType MFD4].value).to(equal(@"MFD4"));
expect([SDLDisplayType MFD5].value).to(equal(@"MFD5"));
- //NOT DEFINED IN SPEC
expect([SDLDisplayType GEN3_8_INCH].value).to(equal(@"GEN3_8-INCH"));
+ expect([SDLDisplayType GENERIC].value).to(equal(@"SDL_GENERIC"));
});
});
describe(@"ValueOf Tests", ^ {
@@ -38,8 +38,8 @@ describe(@"ValueOf Tests", ^ {
expect([SDLDisplayType valueOf:@"MFD3"]).to(equal([SDLDisplayType MFD3]));
expect([SDLDisplayType valueOf:@"MFD4"]).to(equal([SDLDisplayType MFD4]));
expect([SDLDisplayType valueOf:@"MFD5"]).to(equal([SDLDisplayType MFD5]));
- //NOT DEFINED IN SPEC
expect([SDLDisplayType valueOf:@"GEN3_8-INCH"]).to(equal([SDLDisplayType GEN3_8_INCH]));
+ expect([SDLDisplayType valueOf:@"SDL_GENERIC"]).to(equal([SDLDisplayType GENERIC]));
});
it(@"Should return nil when invalid", ^ {
@@ -60,8 +60,8 @@ describe(@"Value List Tests", ^ {
[SDLDisplayType MFD3],
[SDLDisplayType MFD4],
[SDLDisplayType MFD5],
- //NOT DEFINED IN SPEC
- [SDLDisplayType GEN3_8_INCH]] copy];
+ [SDLDisplayType GEN3_8_INCH],
+ [SDLDisplayType GENERIC]] copy];
});
it(@"Should contain all defined enum values", ^ {
@@ -77,4 +77,4 @@ describe(@"Value List Tests", ^ {
});
});
-QuickSpecEnd \ No newline at end of file
+QuickSpecEnd