diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2020-12-02 11:20:25 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2020-12-02 11:20:25 -0500 |
commit | 2ebcf41eb21a9751beeb67c9f4adee6109b5f710 (patch) | |
tree | 90337f91c9fcb8f4f733353c0b3fe598eac2f3b8 | |
parent | a16f7d4d5e38088064255f2cc9ff906a2b2d61b3 (diff) | |
download | sdl_ios-2ebcf41eb21a9751beeb67c9f4adee6109b5f710.tar.gz |
Log fixes and extra test
3 files changed, 13 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLVoiceCommandManager.m b/SmartDeviceLink/private/SDLVoiceCommandManager.m index 49f1e7b99..fc0048736 100644 --- a/SmartDeviceLink/private/SDLVoiceCommandManager.m +++ b/SmartDeviceLink/private/SDLVoiceCommandManager.m @@ -105,7 +105,7 @@ UInt32 const VoiceCommandIdMin = 1900000000; - (void)setVoiceCommands:(NSArray<SDLVoiceCommand *> *)voiceCommands { if (voiceCommands == self.voiceCommands) { - SDLLogD(@"New voice commands are equivalent to existing voice commands, skipping..."); + SDLLogD(@"New voice commands are equal to the existing voice commands, skipping..."); return; } diff --git a/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m b/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m index 0d4df4551..c233a11b4 100644 --- a/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m +++ b/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN SDLLogV(@"Sending voice commands progress: %f", percentComplete); } completionHandler:^(BOOL success) { if (!success) { - SDLLogE(@"Failed to send main menu commands: %@", errors); + SDLLogE(@"Failed to send voice commands: %@", errors); weakSelf.internalError = [NSError sdl_menuManager_failedToUpdateWithDictionary:errors]; return completionHandler(); } diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m index c35f9d5f9..d6ba3101b 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m @@ -106,6 +106,17 @@ describe(@"voice command manager", ^{ expect(testManager.transactionQueue.isSuspended).to(beFalse()); expect(testManager.transactionQueue.operationCount).to(equal(1)); }); + + describe(@"when the new voice commands is identical to the existing ones", ^{ + beforeEach(^{ + testManager.voiceCommands = @[testVoiceCommand]; + testManager.voiceCommands = @[testVoiceCommand]; + }); + + it(@"should only have one operation", ^{ + expect(testManager.transactionQueue.operationCount).to(equal(1)); + }); + }); }); // on disconnect |