summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-02-18 15:46:07 -0500
committerJoel Fischer <joeljfischer@gmail.com>2020-02-18 15:46:07 -0500
commit8eaebb8a33a103202f71970c039ec3b05f172a74 (patch)
treeefbd34e053116a12442b93384a6da44d37534064
parentb32a989be79254bea4e26ad3535a9553a54af700 (diff)
downloadsdl_ios-bugfix/issue-1557-revert-nsdictionary-deprecations.tar.gz
Remove deprecations of structs -> dictionary and visa versabugfix/issue-1557-revert-nsdictionary-deprecations
-rw-r--r--SmartDeviceLink/SDLProtocol.m4
-rw-r--r--SmartDeviceLink/SDLRPCStruct.h4
-rw-r--r--SmartDeviceLink/SDLRPCStruct.m3
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m6
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m3
5 files changed, 2 insertions, 18 deletions
diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m
index f71da8354..29c7ca38f 100644
--- a/SmartDeviceLink/SDLProtocol.m
+++ b/SmartDeviceLink/SDLProtocol.m
@@ -286,11 +286,7 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError *__autoreleasing *)error {
NSParameterAssert(message != nil);
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[message serializeAsDictionary:(Byte)[SDLGlobals sharedGlobals].protocolVersion.major] options:kNilOptions error:error];
-#pragma clang diagnostic pop
if (error != nil) {
SDLLogW(@"Error encoding JSON data: %@", *error);
diff --git a/SmartDeviceLink/SDLRPCStruct.h b/SmartDeviceLink/SDLRPCStruct.h
index 523400261..e8a36d903 100644
--- a/SmartDeviceLink/SDLRPCStruct.h
+++ b/SmartDeviceLink/SDLRPCStruct.h
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param dict A dictionary
* @return A SDLRPCStruct object
*/
-- (instancetype)initWithDictionary:(NSDictionary<NSString *, id> *)dict __deprecated_msg("This is not intended for public use");
+- (instancetype)initWithDictionary:(NSDictionary<NSString *, id> *)dict;
/**
* Converts struct to JSON formatted data
@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param version The protocol version
* @return JSON formatted data
*/
-- (NSDictionary<NSString *, id> *)serializeAsDictionary:(Byte)version __deprecated_msg("This is not intended for public use");
+- (NSDictionary<NSString *, id> *)serializeAsDictionary:(Byte)version;
@end
diff --git a/SmartDeviceLink/SDLRPCStruct.m b/SmartDeviceLink/SDLRPCStruct.m
index e3de83f73..9956df03d 100644
--- a/SmartDeviceLink/SDLRPCStruct.m
+++ b/SmartDeviceLink/SDLRPCStruct.m
@@ -54,8 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
return [self.store description];
}
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ (NSDictionary<NSString *, id> *)sdl_serializeDictionary:(NSDictionary *)dict version:(Byte)version {
NSMutableDictionary<NSString *, id> *ret = [NSMutableDictionary dictionaryWithCapacity:dict.count];
for (NSString *key in dict.keyEnumerator) {
@@ -82,7 +80,6 @@ NS_ASSUME_NONNULL_BEGIN
}
return ret;
}
-#pragma clang diagnostic pop
- (id)copyWithZone:(nullable NSZone *)zone {
SDLRPCStruct *newStruct = [[[self class] allocWithZone:zone] initWithDictionary:_store];
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
index 1a322e373..a8901a2a0 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
@@ -215,10 +215,7 @@ describe(@"SendRPCRequest Tests", ^ {
context(@"During V1 session", ^ {
it(@"Should send the correct data", ^ {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[[[mockRequest stub] andReturn:dictionaryV1] ignoringNonObjectArgs] serializeAsDictionary:1];
-#pragma clang diagnostic pop
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
SDLV1ProtocolHeader *testHeader = [[SDLV1ProtocolHeader alloc] init];
@@ -255,10 +252,7 @@ describe(@"SendRPCRequest Tests", ^ {
context(@"During V2 session", ^ {
it(@"Should send the correct data bulk data when bulk data is available", ^ {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[[[mockRequest stub] andReturn:dictionaryV2] ignoringNonObjectArgs] serializeAsDictionary:2];
-#pragma clang diagnostic pop
[[[mockRequest stub] andReturn:@0x98765] correlationID];
[[[mockRequest stub] andReturn:@"DeleteCommand"] name];
[[[mockRequest stub] andReturn:[NSData dataWithBytes:"COMMAND" length:strlen("COMMAND")]] bulkData];
diff --git a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m
index 8dd6eaf99..1b2c4d348 100644
--- a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m
@@ -14,13 +14,10 @@ QuickSpecBegin(SDLRPCStructSpec)
describe(@"SerializeAsDictionary Tests", ^ {
it(@"Should serialize correctly", ^ {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSMutableDictionary<NSString *, id> *dict = [@{@"Key":@"Value", @"Answer":@42, @"Struct":[[SDLRPCStruct alloc] initWithDictionary:[@{@"Array":@[@1, @1, @1, @1]} mutableCopy]]} mutableCopy];
SDLRPCStruct* testStruct = [[SDLRPCStruct alloc] initWithDictionary:dict];
expect([testStruct serializeAsDictionary:2]).to(equal([@{@"Key":@"Value", @"Answer":@42, @"Struct":@{@"Array":@[@1, @1, @1, @1]}} mutableCopy]));
-#pragma clang diagnostic pop
});
});