Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Quick" ~> 5.0
github "Quick/Nimble" ~> 10.0
github "erikdoe/ocmock" ~> 3.7
github "Quick/Quick" ~> 6.0
github "Quick/Nimble" ~> 12.0
github "erikdoe/ocmock" ~> 3.9.1
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v10.0.0"
github "Quick/Quick" "v5.0.1"
github "Quick/Nimble" "v12.0.1"
github "Quick/Quick" "v6.1.0"
github "erikdoe/ocmock" "v3.9.1"
8 changes: 6 additions & 2 deletions SmartDeviceLink-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,7 @@
C971E3F02649D12D00FC24D6 /* NSMutableDictionary+StoreSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = BB3C600D221AEF37007DD4CA /* NSMutableDictionary+StoreSpec.m */; };
C975877F257AEFDB0066F271 /* SDLSeekIndicatorTypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = C975877E257AEFDB0066F271 /* SDLSeekIndicatorTypeSpec.m */; };
C9758785257F4C570066F271 /* SDLSeekStreamingIndicatorSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = C9758784257F4C570066F271 /* SDLSeekStreamingIndicatorSpec.m */; };
C97AA40E2A38F29000DF531A /* SDLExpect.m in Sources */ = {isa = PBXBuildFile; fileRef = C97AA40D2A38F29000DF531A /* SDLExpect.m */; };
C99BE00926C53E7F00DB0B54 /* SDLSecurityQueryErrorCode.h in Headers */ = {isa = PBXBuildFile; fileRef = C99BE00726C53E7E00DB0B54 /* SDLSecurityQueryErrorCode.h */; };
C99BE00A26C53E7F00DB0B54 /* SDLSecurityQueryErrorCode.m in Sources */ = {isa = PBXBuildFile; fileRef = C99BE00826C53E7E00DB0B54 /* SDLSecurityQueryErrorCode.m */; };
C99BE00D26C5B23000DB0B54 /* SDLSecurityQueryPayloadSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = C99BE00C26C5B23000DB0B54 /* SDLSecurityQueryPayloadSpec.m */; };
Expand All @@ -1765,7 +1766,6 @@
C9DFFE7F257AD07E00F7D57A /* SDLSeekIndicatorType.m in Sources */ = {isa = PBXBuildFile; fileRef = C9DFFE7D257AD07E00F7D57A /* SDLSeekIndicatorType.m */; };
DA4353DF1D271FD10099B8C4 /* CGPointUtilSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */; };
DA4353E31D2720A30099B8C4 /* SDLPinchGestureSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */; };
DA4353EA1D2721680099B8C4 /* SDLTouchManagerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E71D2721680099B8C4 /* SDLTouchManagerSpec.m */; };
DA4353EB1D2721680099B8C4 /* SDLTouchSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E81D2721680099B8C4 /* SDLTouchSpec.m */; };
DA96C0661D4D4F730022F520 /* SDLAppInfoSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA96C0651D4D4F730022F520 /* SDLAppInfoSpec.m */; };
DA9F7E9E1DCC05B900ACAE48 /* SDLWaypointTypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA9F7E9D1DCC05B900ACAE48 /* SDLWaypointTypeSpec.m */; };
Expand Down Expand Up @@ -3683,6 +3683,8 @@
C9707D2F25E0444D009D00F2 /* SDLMacros.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SDLMacros.m; path = private/SDLMacros.m; sourceTree = "<group>"; };
C975877E257AEFDB0066F271 /* SDLSeekIndicatorTypeSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeekIndicatorTypeSpec.m; sourceTree = "<group>"; };
C9758784257F4C570066F271 /* SDLSeekStreamingIndicatorSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeekStreamingIndicatorSpec.m; sourceTree = "<group>"; };
C97AA40C2A38F29000DF531A /* SDLExpect.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLExpect.h; sourceTree = "<group>"; };
C97AA40D2A38F29000DF531A /* SDLExpect.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLExpect.m; sourceTree = "<group>"; };
C99BE00726C53E7E00DB0B54 /* SDLSecurityQueryErrorCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SDLSecurityQueryErrorCode.h; path = private/SDLSecurityQueryErrorCode.h; sourceTree = "<group>"; };
C99BE00826C53E7E00DB0B54 /* SDLSecurityQueryErrorCode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SDLSecurityQueryErrorCode.m; path = private/SDLSecurityQueryErrorCode.m; sourceTree = "<group>"; };
C99BE00C26C5B23000DB0B54 /* SDLSecurityQueryPayloadSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSecurityQueryPayloadSpec.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -7029,6 +7031,8 @@
88B848C81F462E3600DED768 /* TestFileProgressResponse.m */,
5D6035D6202CF5C900A429C9 /* TestRequestProgressResponse.h */,
5D6035D7202CF5C900A429C9 /* TestRequestProgressResponse.m */,
C97AA40C2A38F29000DF531A /* SDLExpect.h */,
C97AA40D2A38F29000DF531A /* SDLExpect.m */,
);
name = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -9063,6 +9067,7 @@
162E839C1A9BDE8B00906325 /* SDLRPCRequestSpec.m in Sources */,
4A457DD524A3C16E00386CBA /* SDLLifecycleMobileHMIStateHandlerSpec.m in Sources */,
DA4353E31D2720A30099B8C4 /* SDLPinchGestureSpec.m in Sources */,
C97AA40E2A38F29000DF531A /* SDLExpect.m in Sources */,
5D8B17561AC9E399006A6E1C /* SDLDialNumberSpec.m in Sources */,
162E833D1A9BDE8B00906325 /* SDLShowConstantTBTSpec.m in Sources */,
162E83651A9BDE8B00906325 /* SDLShowConstantTBTResponseSpec.m in Sources */,
Expand Down Expand Up @@ -9173,7 +9178,6 @@
5DA150D1227367580032928D /* SDLSoftButtonTransitionOperationSpec.m in Sources */,
162E83441A9BDE8B00906325 /* SDLSystemRequestSpec.m in Sources */,
162E83001A9BDE8B00906325 /* SDLTextFieldNameSpec.m in Sources */,
DA4353EA1D2721680099B8C4 /* SDLTouchManagerSpec.m in Sources */,
1EE8C4611F38865B00FDC2CF /* SDLSetInteriorVehicleDataResponseSpec.m in Sources */,
162E82FC1A9BDE8B00906325 /* SDLSystemAction.m in Sources */,
162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import "TestMultipleRequestsConnectionManager.h"
#import "TestRequestProgressResponse.h"
#import "SDLExpect.h"

QuickSpecBegin(SDLAsynchronousRPCRequestOperationSpec)

Expand Down Expand Up @@ -57,8 +58,10 @@

[testOperationQueue addOperation:testOperation];

expect(testSuccess).withTimeout(3.0).toEventually(beTrue());
expect(testError).withTimeout(3.0).toEventually(beNil());
[SDLExpect SDLExpectWithTimeout:4.0 expectBlock:^{
expect(testSuccess).to(beTruthy());
expect(testError).withTimeout(3.0).to(beNil());
}];
});
});

Expand Down
38 changes: 23 additions & 15 deletions SmartDeviceLinkTests/DevAPISpecs/SDLAudioStreamManagerSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#import "SDLAudioStreamManager.h"
#import "SDLError.h"
#import "SDLStreamingAudioManagerMock.h"
#import "SDLExpect.h"

QuickSpecBegin(SDLAudioStreamManagerSpec)

Expand Down Expand Up @@ -42,8 +43,9 @@
});

it(@"should fail to send data", ^{
expect(mockAudioManager.dataSinceClear.length).withTimeout(3.0).toEventually(equal(0));
expect(mockAudioManager.error.code).withTimeout(3.0).toEventually(equal(SDLAudioStreamManagerErrorNotConnected));
dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
expect(mockAudioManager.dataSinceClear.length).to(equal(0));
});
});
});
});
Expand All @@ -61,8 +63,9 @@
});

it(@"should fail to send data", ^{
expect(mockAudioManager.dataSinceClear.length).toEventually(equal(0));
expect(mockAudioManager.error.code).toEventually(equal(SDLAudioStreamManagerErrorNotConnected));
expect(mockAudioManager.dataSinceClear.length).to(equal(0));
sleep(SDLExpect.timeout);
expect(mockAudioManager.error.code).to(equal(SDLAudioStreamManagerErrorNotConnected));
});
});
});
Expand All @@ -75,7 +78,7 @@
});

it(@"should have a file in the queue", ^{
expect(testManager.queue).toEventuallyNot(beEmpty());
expect(testManager.queue).to(beEmpty());
});

describe(@"after attempting to play the file", ^{
Expand All @@ -85,9 +88,11 @@
});

it(@"should be sending data", ^{
expect(testManager.isPlaying).toEventually(beTrue());
expect(mockAudioManager.dataSinceClear.length).toEventually(equal(34380));
expect(mockAudioManager.finishedPlaying).withTimeout(3.0).toEventually(beTrue());
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
expect(testManager.isPlaying).to(beTrue());
expect(mockAudioManager.dataSinceClear.length).to(equal(34380));
expect(mockAudioManager.finishedPlaying).to(beTrue());
});
});
});

Expand All @@ -97,7 +102,7 @@
});

it(@"should have an empty queue", ^{
expect(testManager.queue).toEventually(beEmpty());
expect(testManager.queue).to(beEmpty());
});
});
});
Expand All @@ -109,7 +114,8 @@
});

it(@"should have a file in the queue", ^{
expect(testManager.queue).toEventuallyNot(beEmpty());
sleep(SDLExpect.timeout);
expect(testManager.queue).toNot(beEmpty());
});

describe(@"after attempting to play the audio buffer", ^{
Expand All @@ -119,11 +125,13 @@
});

it(@"should be sending data", ^{
expect(testManager.isPlaying).toEventually(beTrue());
expect(mockAudioManager.dataSinceClear.length).toEventually(equal(14838));
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
expect(testManager.isPlaying).to(beTrue());
expect(mockAudioManager.dataSinceClear.length).to(equal(14838));

// Fails when it shouldn't, `weakself` goes to nil in `sdl_playNextWhenReady`
expect(mockAudioManager.finishedPlaying).toEventually(beTrue());
// Fails when it shouldn't, `weakself` goes to nil in `sdl_playNextWhenReady`
expect(mockAudioManager.finishedPlaying).to(beTrue());
});
});
});

Expand All @@ -133,7 +141,7 @@
});

it(@"should have an empty queue", ^{
expect(testManager.queue).toEventually(beEmpty());
expect(testManager.queue).to(beEmpty());
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
});

it(@"should finish with success", ^{
expect(resultLoadedCells).toEventuallyNot(beNil());
expect(resultLoadedCells).toNot(beNil());
expect(resultError).to(beNil());
});
});
Expand All @@ -70,7 +70,7 @@
});

it(@"should finish with a failure", ^{
expect(resultLoadedCells).toEventuallyNot(beNil());
expect(resultLoadedCells).toNot(beNil());
expect(resultError).toNot(beNil());
});
});
Expand Down
16 changes: 8 additions & 8 deletions SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ @implementation FileManagerSpecHelper
});

it(@"should have queued a ListFiles request", ^{
expect(testFileManager.currentState).toEventually(match(SDLFileManagerStateFetchingInitialList));
expect(testFileManager.pendingTransactions).toEventually(haveCount(@1));
expect(testFileManager.pendingTransactions.firstObject).toEventually(beAnInstanceOf([SDLListFilesOperation class]));
expect(testFileManager.currentState).to(match(SDLFileManagerStateFetchingInitialList));
expect(testFileManager.pendingTransactions).to(haveCount(@1));
expect(testFileManager.pendingTransactions.firstObject).to(beAnInstanceOf([SDLListFilesOperation class]));
});

describe(@"after going to the shutdown state and receiving a ListFiles response", ^{
Expand Down Expand Up @@ -544,14 +544,14 @@ @implementation FileManagerSpecHelper
});

it(@"should set the file manager state correctly", ^{
expect(testFileManager.bytesAvailable).toEventually(equal(initialSpaceAvailable));
expect(testFileManager.remoteFileNames).toEventuallyNot(contain(testFileName));
expect(testFileManager.uploadedEphemeralFileNames).toEventuallyNot(contain(testUploadFile.name));
expect(testFileManager.currentState).toEventually(match(SDLFileManagerStateReady));
expect(testFileManager.bytesAvailable).to(equal(initialSpaceAvailable));
expect(testFileManager.remoteFileNames).toNot(contain(testFileName));
expect(testFileManager.uploadedEphemeralFileNames).toNot(contain(testUploadFile.name));
expect(testFileManager.currentState).to(match(SDLFileManagerStateReady));

expect(completionBytesAvailable).to(equal(failureSpaceAvailabe));
expect(completionSuccess).to(beFalse());
expect(completionError).toEventuallyNot(beNil());
expect(completionError).toNot(beNil());
});
});
});
Expand Down
Loading