summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-08-29 14:05:03 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-08-29 14:05:03 -0400
commite10a5aa635877494f4fc5b3b3ec63cd303a7c802 (patch)
treedfb0b7d74f2515b78d177dd0dc078cdefa4644a3
parenta674dd924dfbf6772b250716a3b03620d8162805 (diff)
downloadsdl_ios-e10a5aa635877494f4fc5b3b3ec63cd303a7c802.tar.gz
Fix #715 for v5.0.0
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadEndService.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadNak.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartService.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartService.m2
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m2
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m14
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m13
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m13
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m14
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m14
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m13
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m14
14 files changed, 102 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
index ac969d07b..be5460bb4 100644
--- a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
+++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
_mtu = SDLControlFrameInt64NotFound;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadEndService.m b/SmartDeviceLink/SDLControlFramePayloadEndService.m
index 8399da517..372400e7d 100644
--- a/SmartDeviceLink/SDLControlFramePayloadEndService.m
+++ b/SmartDeviceLink/SDLControlFramePayloadEndService.m
@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
_hashId = SDLControlFrameInt32NotFound;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadNak.m b/SmartDeviceLink/SDLControlFramePayloadNak.m
index 4402dea47..15f5c517c 100644
--- a/SmartDeviceLink/SDLControlFramePayloadNak.m
+++ b/SmartDeviceLink/SDLControlFramePayloadNak.m
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
self = [super init];
if (!self) return nil;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m
index 222370d24..95245e93e 100644
--- a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m
@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
self = [super init];
if (!self) return nil;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m
index e4b8347fa..cc2c2c3a5 100644
--- a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m
@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
_hashId = SDLControlFrameInt32NotFound;
_mtu = SDLControlFrameInt64NotFound;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m
index 800c3ace8..d33698ebb 100644
--- a/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m
@@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
_height = SDLControlFrameInt32NotFound;
_width = SDLControlFrameInt32NotFound;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
index d74d1c68c..f16f4b108 100644
--- a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
@@ -45,7 +45,7 @@
_height = SDLControlFrameInt32NotFound;
_width = SDLControlFrameInt32NotFound;
- if (data != nil) {
+ if (data.length > 0) {
[self sdl_parse:data];
}
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m
index ef0d8fae2..df7bd1305 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m
@@ -54,4 +54,18 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadNak *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadNak alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.rejectedParams).to(beNil());
+ });
+});
+
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m
index 1af113777..c93d72c9b 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m
@@ -77,4 +77,17 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadVideoStartService *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadVideoStartService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m
index cc7db881c..c817f44f4 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m
@@ -83,4 +83,17 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadVideoStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m
index a168fc39d..548110d0d 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m
@@ -57,4 +57,18 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadAudioStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.mtu).to(equal(-1));
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m
index 8f7a0c3d2..a59c95811 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m
@@ -55,4 +55,18 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadEndService *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadEndService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.hashId).to(equal(-1));
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m
index ee6793249..7397f5713 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m
@@ -68,4 +68,17 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadRPCStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m
index e8e773c8a..f39204330 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m
@@ -57,4 +57,18 @@ describe(@"Test decoding data", ^{
});
});
+describe(@"Test nil data", ^{
+ __block SDLControlFramePayloadRPCStartService *testPayload = nil;
+ __block NSData *testData = nil;
+
+ beforeEach(^{
+ testPayload = [[SDLControlFramePayloadRPCStartService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.protocolVersion).to(beNil());
+ expect(testPayload.data.length).to(equal(0));
+ });
+});
+
QuickSpecEnd