summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2021-09-22 14:22:53 -0400
committerJoel Fischer <joeljfischer@gmail.com>2021-09-22 14:22:53 -0400
commitbbe5454aa88168c25fbc956e79832ebc63177330 (patch)
treee1e5db106d9bfef74d872ff333c74f01c01ecf23
parent09e5e226d01ed512cec25e10de379fcbb5235440 (diff)
downloadsdl_ios-bbe5454aa88168c25fbc956e79832ebc63177330.tar.gz
Fix SDLFile copying
-rw-r--r--SmartDeviceLink/public/SDLFile.m13
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m2
2 files changed, 13 insertions, 2 deletions
diff --git a/SmartDeviceLink/public/SDLFile.m b/SmartDeviceLink/public/SDLFile.m
index b3efaf200..89b8042b4 100644
--- a/SmartDeviceLink/public/SDLFile.m
+++ b/SmartDeviceLink/public/SDLFile.m
@@ -161,7 +161,18 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - NSCopying
- (id)copyWithZone:(nullable NSZone *)zone {
- return [[self.class allocWithZone:zone] initWithFileURL:_fileURL name:_name persistent:_persistent];
+ SDLFile *fileCopy = [[self.class allocWithZone:zone] init];
+ fileCopy.name = _name.copy;
+ fileCopy.fileURL = _fileURL.copy;
+ fileCopy.fileType = _fileType.copy;
+ fileCopy.persistent = _persistent;
+ fileCopy.isStaticIcon = _isStaticIcon;
+
+ if (_data.length == 0 && _fileURL != nil) {
+ fileCopy.data = _data.copy;
+ }
+
+ return fileCopy;
}
#pragma mark - NSObject overrides
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
index 45e4b7efc..dfb910a99 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
@@ -293,7 +293,7 @@ describe(@"a preload choices operation", ^{
});
});
- fcontext(@"when artworks are not already on the system", ^{
+ context(@"when artworks are not already on the system", ^{
beforeEach(^{
OCMStub([testFileManager hasUploadedFile:[OCMArg isNotNil]]).andReturn(NO);
});