AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions | Variables
alexaClientSDK::speakerManager::test Namespace Reference

Unit Tests and Mocks for Speaker API Capability Agent. More...

Classes

class  ChannelVolumeManagerTest
 Test fixture for ChannelVolumeManager. More...
 
class  MockMiscStorage
 
class  MockSpeakerManagerConfig
 Mock object for SpeakerManagerConfigInterface. More...
 
class  MockSpeakerManagerObserver
 Mock object for SpeakerManagerObserverInterface. More...
 
class  MockSpeakerManagerStorage
 Mock object for SpeakerManagerStorageInterface. More...
 
class  MockSpeakerManagerStorageWithHelpers
 Extend MockSpeakerManagerStorage with helpers. More...
 
class  SpeakerManagerConfigHelperTest
 Test fixture for SpeakerManagerConfigHelper. More...
 
class  SpeakerManagerConfigTest
 Test fixture for SpeakerManagerConfig. More...
 
class  SpeakerManagerMiscStorageTest
 Test fixture for SpeakerManagerMiscStorage. More...
 
class  SpeakerManagerTest
 Test fixture for SpeakerManager unit tests. More...
 

Functions

static int8_t defaultVolumeCurve (int8_t currentVolume)
 
 TEST_F (ChannelVolumeManagerTest, test_createTest)
 
 TEST_F (ChannelVolumeManagerTest, test_startDuckingCallAttenuatesVolume)
 
 TEST_F (ChannelVolumeManagerTest, test_stopDuckingCallRestoresVolume)
 
 TEST_F (ChannelVolumeManagerTest, test_getSpeakerSettingsReturnsUnduckedVolume)
 
 TEST_F (ChannelVolumeManagerTest, test_volumeIsRestoredToLatestUnduckedVolume)
 
 TEST_F (ChannelVolumeManagerTest, test_startDuckingWhenAlreadyDucked)
 
 TEST_F (ChannelVolumeManagerTest, test_stopDuckingWhenAlreadyUnducked)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_initDoesntCallLoadSave)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getPersistentStorageFromConfiguration)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getMinUnmuteVolumeFromConfiguration)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getPersistentStorageReturnsDefaults)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getMinUnmuteVolumeReturnsDefaults)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getRestoreMuteStateReturnsDefaults)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getPersistentStorageReturnsTrue)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getPersistentStorageReturnsFalse)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getRestoreMuteStateReturnsTrue)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_getRestoreMuteStateReturnsFalse)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_loadStateDelegate)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_loadStateFromConfig)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_loadStateDefaults)
 
 TEST_F (SpeakerManagerConfigHelperTest, test_saveState)
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateMissingConfig)
 Validate nothing breaks when config is missing. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateEmptyConfig)
 Validate nothing breaks when config is empty. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidatePersistentStorageConfig)
 Validate persistentVolume entry is read correctly. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateRestoreMuteStateConfig)
 Validate restoreMuteState entry is read correctly. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateMinUnmuteVolumeConfig)
 Validate minUnmuteVolume entry is read correctly. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateDefaultSpeakerVolumeConfig)
 Validate defaultSpeakerVolume entry is read correctly. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateDefaultAlertsVolumeConfig)
 Validate defaultAlertsVolume entry is read correctly. More...
 
 TEST_F (SpeakerManagerConfigTest, test_ValidateAllValues)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_nullMiscStorage)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_FailedOpen)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_OpenAndFailedCheckTableStatus)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_OpenAndFailedCreateTable)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_CreateTable)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_OpenedAndTableExists)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_GetPut)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_failedGet)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_FailedPut)
 
 TEST_F (SpeakerManagerMiscStorageTest, test_parseJson)
 
static std::chrono::milliseconds TIMEOUT (1000)
 Timeout when waiting for futures to be set. More...
 
std::string generateVolumeStateJson (SpeakerInterface::SpeakerSettings settings)
 Helper function to generate the VolumeState in JSON for the ContextManager. More...
 
 TEST_F (SpeakerManagerTest, test_nullContextManager)
 
 TEST_F (SpeakerManagerTest, test_nullMessageSender)
 
 TEST_F (SpeakerManagerTest, test_nullExceptionSender)
 
 TEST_F (SpeakerManagerTest, test_noChannelVolumeInterfaces)
 
 TEST_F (SpeakerManagerTest, test_addChannelVolumeInterfaceDoesNotOverwriteDefaults)
 
 TEST_F (SpeakerManagerTest, test_contextManagerSetStateConstructor)
 
 TEST_F (SpeakerManagerTest, test_setVolumeUnderBounds)
 
 TEST_F (SpeakerManagerTest, test_setVolumeUnderBoundsWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_setVolumeOverBounds)
 
 TEST_F (SpeakerManagerTest, test_setVolumeOverBoundsWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_adjustVolumeUnderBounds)
 
 TEST_F (SpeakerManagerTest, test_adjustVolumeUnderBoundsWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_adjustVolumeOverBounds)
 
 TEST_F (SpeakerManagerTest, test_adjustVolumeOverBoundsWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_getCachedSettings)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenAdjustVolumeUnchanged)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenAdjustVolumeUnchangedWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenSetVolumeUnchanged)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenSetVolumeUnchangedWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_getConfiguration)
 
 TEST_F (SpeakerManagerTest, test_addDuplicatedChannelVolumeInterfaces)
 
 TEST_F (SpeakerManagerTest, test_addNullObserver)
 
 TEST_F (SpeakerManagerTest, test_removeSpeakerManagerObserver)
 
 TEST_F (SpeakerManagerTest, test_removeNullObserver)
 
 TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForSetVolume)
 
 TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForAdjustVolume)
 
 TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForSetMute)
 
 TEST_F (SpeakerManagerTest, test_retryAndApplySettingsFails)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, SpeakerManagerTest, ::testing::Values(std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME }))
 
 TEST_P (SpeakerManagerTest, test_setVolume)
 
 TEST_P (SpeakerManagerTest, test_setVolumeWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdate)
 
 TEST_P (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchanged)
 
 TEST_F (SpeakerManagerTest, test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchangedWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateUnderBounds)
 
 TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateUnderBoundsWithPersistentStorage)
 
 TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateOverBounds)
 
 TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateOverBoundsWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_adjustVolume)
 
 TEST_P (SpeakerManagerTest, test_adjustVolumeWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_setMute)
 
 TEST_P (SpeakerManagerTest, test_setMuteWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_getSpeakerSettings)
 
 TEST_P (SpeakerManagerTest, test_setVolumeDirective)
 
 TEST_P (SpeakerManagerTest, test_setVolumeDirectiveWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_adjustVolumeDirective)
 
 TEST_P (SpeakerManagerTest, test_adjustVolumeDirectiveWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_setMuteDirective)
 
 TEST_P (SpeakerManagerTest, test_setMuteDirectiveWithPersistentStorage)
 
 TEST_P (SpeakerManagerTest, test_setVolumeDirectiveWhenMuted)
 
 TEST_P (SpeakerManagerTest, test_getSpeakerConfigDefaults)
 
 TEST_P (SpeakerManagerTest, test_getSpeakerConfigFromStorage)
 

Variables

static const SpeakerInterface::SpeakerSettings INITIAL_SETTINGS {AVS_SET_VOLUME_MAX / 2, false}
 Initial Settings for underlying SpeakerInterface. More...
 
static const auto JSON_TEST_CONFIG_MISSING
 
static const auto JSON_TEST_CONFIG_EMPTY
 Configuration with speaker manager root but without entries. More...
 
static const auto JSON_TEST_CONFIG_PERSISTENT_STORAGE
 Configuration with speaker manager root with persistentStorage. More...
 
static const auto JSON_TEST_CONFIG_MIN_UNMUTE_VOLUME
 Configuration with speaker manager root with minUnmuteVolume. More...
 
static const auto JSON_TEST_CONFIG_DEFAULT_SPEAKER_VOLUME
 Configuration with speaker manager root with defaultSpeakerVolume. More...
 
static const auto JSON_TEST_CONFIG_DEFAULT_ALERTS_VOLUME
 Configuration with speaker manager root with defaultAlertsVolume. More...
 
static const auto JSON_TEST_CONFIG_RESTORE_MUTE_STATE
 Configuration with speaker manager root with defaultAlertsVolume. More...
 
static const auto JSON_TEST_CONFIG
 Full configuration. More...
 
static const std::string JSON_PAYLOAD
 The MessageId identifer. More...
 
static const auto MESSAGE_ID = "messageId"
 The MessageId identifer. More...
 
static const auto VOLUME_PAYLOAD
 A SetVolume/AdjustVolume payload. More...
 
static const auto MUTE_PAYLOAD
 A SetMute payload. More...
 
static const auto UNMUTE_PAYLOAD
 A SetMute payload to unmute. More...
 
static const int8_t VALID_VOLUME_ADJUSTMENT = 10
 A valid delta to adjust the volume. More...
 

Detailed Description

Unit Tests and Mocks for Speaker API Capability Agent.

This namespace contains unit test for Speaker API capability agent implementation.

See also
Capability Agent for AVS Speaker 1.0 Interface

Function Documentation

◆ defaultVolumeCurve()

static int8_t alexaClientSDK::speakerManager::test::defaultVolumeCurve ( int8_t  currentVolume)
static

◆ generateVolumeStateJson()

std::string alexaClientSDK::speakerManager::test::generateVolumeStateJson ( SpeakerInterface::SpeakerSettings  settings)

Helper function to generate the VolumeState in JSON for the ContextManager.

◆ INSTANTIATE_TEST_CASE_P()

alexaClientSDK::speakerManager::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
SpeakerManagerTest  ,
::testing::Values(std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME })   
)

Create different combinations of Type for parameterized tests (TEST_P).

◆ TEST_F() [1/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_initDoesntCallLoadSave   
)

◆ TEST_F() [2/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getPersistentStorageFromConfiguration   
)

◆ TEST_F() [3/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_createTest   
)

◆ TEST_F() [4/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getMinUnmuteVolumeFromConfiguration   
)

◆ TEST_F() [5/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_startDuckingCallAttenuatesVolume   
)

◆ TEST_F() [6/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_nullMiscStorage   
)

◆ TEST_F() [7/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_FailedOpen   
)

◆ TEST_F() [8/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_stopDuckingCallRestoresVolume   
)

◆ TEST_F() [9/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getPersistentStorageReturnsDefaults   
)

◆ TEST_F() [10/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_OpenAndFailedCheckTableStatus   
)

◆ TEST_F() [11/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getMinUnmuteVolumeReturnsDefaults   
)

◆ TEST_F() [12/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_getSpeakerSettingsReturnsUnduckedVolume   
)

◆ TEST_F() [13/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_OpenAndFailedCreateTable   
)

◆ TEST_F() [14/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateMissingConfig   
)

Validate nothing breaks when config is missing.

◆ TEST_F() [15/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getRestoreMuteStateReturnsDefaults   
)

◆ TEST_F() [16/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_volumeIsRestoredToLatestUnduckedVolume   
)

◆ TEST_F() [17/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getPersistentStorageReturnsTrue   
)

◆ TEST_F() [18/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_CreateTable   
)

◆ TEST_F() [19/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateEmptyConfig   
)

Validate nothing breaks when config is empty.

◆ TEST_F() [20/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getPersistentStorageReturnsFalse   
)

◆ TEST_F() [21/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_startDuckingWhenAlreadyDucked   
)

◆ TEST_F() [22/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getRestoreMuteStateReturnsTrue   
)

◆ TEST_F() [23/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_OpenedAndTableExists   
)

◆ TEST_F() [24/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidatePersistentStorageConfig   
)

Validate persistentVolume entry is read correctly.

◆ TEST_F() [25/73]

alexaClientSDK::speakerManager::test::TEST_F ( ChannelVolumeManagerTest  ,
test_stopDuckingWhenAlreadyUnducked   
)

◆ TEST_F() [26/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_getRestoreMuteStateReturnsFalse   
)

◆ TEST_F() [27/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_GetPut   
)

◆ TEST_F() [28/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_loadStateDelegate   
)

◆ TEST_F() [29/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateRestoreMuteStateConfig   
)

Validate restoreMuteState entry is read correctly.

◆ TEST_F() [30/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateMinUnmuteVolumeConfig   
)

Validate minUnmuteVolume entry is read correctly.

◆ TEST_F() [31/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_loadStateFromConfig   
)

◆ TEST_F() [32/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_failedGet   
)

◆ TEST_F() [33/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateDefaultSpeakerVolumeConfig   
)

Validate defaultSpeakerVolume entry is read correctly.

◆ TEST_F() [34/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_loadStateDefaults   
)

◆ TEST_F() [35/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateDefaultAlertsVolumeConfig   
)

Validate defaultAlertsVolume entry is read correctly.

◆ TEST_F() [36/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_FailedPut   
)

◆ TEST_F() [37/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigHelperTest  ,
test_saveState   
)

◆ TEST_F() [38/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerConfigTest  ,
test_ValidateAllValues   
)

◆ TEST_F() [39/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerMiscStorageTest  ,
test_parseJson   
)

◆ TEST_F() [40/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_nullContextManager   
)

Tests creating the SpeakerManager with a null contextManager.

◆ TEST_F() [41/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_nullMessageSender   
)

Tests creating the SpeakerManager with a null messageSender.

◆ TEST_F() [42/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_nullExceptionSender   
)

Tests creating the SpeakerManager with a null exceptionSender.

◆ TEST_F() [43/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_noChannelVolumeInterfaces   
)

Tests creating the SpeakerManager with no channelVolumeInterfaces.

◆ TEST_F() [44/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_addChannelVolumeInterfaceDoesNotOverwriteDefaults   
)

Tests that adding a channel volume interface does not overwrite existing default volume settings when persistent storage is enabled.

◆ TEST_F() [45/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_contextManagerSetStateConstructor   
)

Tests that the SpeakerManager initially provides the state at constructor time.

◆ TEST_F() [46/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_setVolumeUnderBounds   
)

Test setVolume with a value that's under the bounds. The operation should fail.

◆ TEST_F() [47/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_setVolumeUnderBoundsWithPersistentStorage   
)

Test setVolume with a value that's under the bounds with persistent storage enabled. The operation should fail.

◆ TEST_F() [48/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_setVolumeOverBounds   
)

Test setVolume with a value that's over the bounds. The operation should fail.

◆ TEST_F() [49/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_setVolumeOverBoundsWithPersistentStorage   
)

Test setVolume with a value that's over the bounds with persistent storage enabled. The operation should fail.

◆ TEST_F() [50/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_adjustVolumeUnderBounds   
)

Test adjustVolume with a value that's under the bounds. The operation should fail.

◆ TEST_F() [51/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_adjustVolumeUnderBoundsWithPersistentStorage   
)

Test adjustVolume with a value that's under the bounds with persistent storage enabled. The operation should fail.

◆ TEST_F() [52/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_adjustVolumeOverBounds   
)

Test adjustVolume with a value that's over the bounds. The operation should fail.

◆ TEST_F() [53/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_adjustVolumeOverBoundsWithPersistentStorage   
)

Test adjustVolume with a value that's over the bounds with persistent storage enabled. The operation should fail.

◆ TEST_F() [54/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_getCachedSettings   
)

Test if one speaker is out of sync, getSpeakingSettings should return the cached value correctly.

◆ TEST_F() [55/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenAdjustVolumeUnchanged   
)

Test adjustVolume when the adjusted volume is unchanged. Should not send an event.

◆ TEST_F() [56/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenAdjustVolumeUnchangedWithPersistentStorage   
)

Test adjustVolume when the adjusted volume is unchanged with persistent storage enabled. Should not send an event.

◆ TEST_F() [57/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenSetVolumeUnchanged   
)

Test setVolume when the new volume is unchanged. Should not send an event.

◆ TEST_F() [58/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenSetVolumeUnchangedWithPersistentStorage   
)

Test setVolume when the new volume is unchanged with persistent storage enabled. Should not send an event.

◆ TEST_F() [59/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_getConfiguration   
)

Test getConfiguration and ensure that all directives are handled.

◆ TEST_F() [60/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_addDuplicatedChannelVolumeInterfaces   
)

Test that adding duplicated ChannelVolumeInterface instances in the SpeakerManager works correctly.

◆ TEST_F() [61/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_addNullObserver   
)

Test that adding a null observer does not cause any errors in the SpeakerManager.

◆ TEST_F() [62/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_removeSpeakerManagerObserver   
)

Test that removing an observer works correctly.

◆ TEST_F() [63/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_removeNullObserver   
)

Test that removing a null observer does not cause any errors in the SpeakerManager.

◆ TEST_F() [64/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_retryAndApplySettingsForSetVolume   
)

Test retry logic for SetVolume on speaker type AVS_SPEAKER_VOLUME. Returning false once for speaker->setVolume() triggers retry and when successful returns the future of value true.

◆ TEST_F() [65/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_retryAndApplySettingsForAdjustVolume   
)

Test retry logic for AdjustVolume on speakers of type AVS_SPEAKER_VOLUME. Return false once for the second speaker during adjustVolume() to trigger a retry. The delta should not be applied again to the first speaker during retry.

◆ TEST_F() [66/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_retryAndApplySettingsForSetMute   
)

Test retry logic for SetMute on speaker type AVS_SPEAKER_VOLUME. Returning false once for speaker->setMute() triggers retry and when successful returns the future of value true.

◆ TEST_F() [67/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_retryAndApplySettingsFails   
)

Test retryAndApplySettings() failure for setVolume, adjustVolume and setMute on speaker type AVS_SPEAKER_VOLUME. Repeatedly returning false for adjustVolume() and setMute() to trigger retries. After retrying maximum times, returning the future of false.

◆ TEST_F() [68/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchanged   
)

Test onExternalSpeakerSettingsUpdate when the new volume is unchanged. Should not send an event.

◆ TEST_F() [69/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchangedWithPersistentStorage   
)

Test onExternalSpeakerSettingsUpdate when the new volume is unchanged with persistent storage enabled. Should not send an event.

◆ TEST_F() [70/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdateUnderBounds   
)

Test onExternalSpeakerSettingsUpdate with a value that's under the bounds. The operation should fail.

◆ TEST_F() [71/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdateUnderBoundsWithPersistentStorage   
)

Test onExternalSpeakerSettingsUpdate with a value that's under the bounds with persistent storage enabled. The operation should fail.

◆ TEST_F() [72/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdateOverBounds   
)

Test onExternalSpeakerSettingsUpdate with a value that's over the bounds. The operation should fail.

◆ TEST_F() [73/73]

alexaClientSDK::speakerManager::test::TEST_F ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdateOverBoundsWithPersistentStorage   
)

Test onExternalSpeakerSettingsUpdate with a value that's over the bounds with persistent storage enabled. The operation should fail.

◆ TEST_P() [1/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setVolume   
)

Parameterized test for setVolume. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [2/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setVolumeWithPersistentStorage   
)

Parameterized test for setVolume with persistent storage enabled. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [3/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdate   
)

Parameterized test for onExternalSpeakerSettingsUpdate. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [4/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_onExternalSpeakerSettingsUpdateWithPersistentStorage   
)

Parameterized test for onExternalSpeakerSettingsUpdate with persistent storage enabled. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [5/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_adjustVolume   
)

Parameterized test for adjustVolume. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [6/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_adjustVolumeWithPersistentStorage   
)

Parameterized test for adjustVolume with persistent storage enabled. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [7/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setMute   
)

Parameterized test for setMute. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [8/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setMuteWithPersistentStorage   
)

Parameterized test for setMute with persistent storage enabled. One event should be sent if an AVS_SPEAKER_VOLUME typed speaker is modified.

◆ TEST_P() [9/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_getSpeakerSettings   
)

Parameterized test for getSpeakerSettings. Operation should succeed with default speaker settings.

◆ TEST_P() [10/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setVolumeDirective   
)

Tests SetVolume Directive. Expect that the volume is unmuted and set, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [11/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setVolumeDirectiveWithPersistentStorage   
)

Tests SetVolume Directive with persistent storage enabled. Expect that the volume is unmuted and set, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [12/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_adjustVolumeDirective   
)

Tests AdjustVolume Directive. Expect that the volume is unmuted and adjusted, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [13/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_adjustVolumeDirectiveWithPersistentStorage   
)

Tests AdjustVolume Directive with persistent storage enabled. Expect that the volume is unmuted and adjusted, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [14/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setMuteDirective   
)

Tests SetMute Directive. Expect that the volume is muted, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [15/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setMuteDirectiveWithPersistentStorage   
)

Tests SetMute Directive with persistent storage enabled. Expect that the volume is muted, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [16/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_setVolumeDirectiveWhenMuted   
)

Test setVolume when unmute Directive sent. Setup test by setting volume to 0 and mute to true. Expect that the volume is unmuted and set to MIN_UNMUTE_VOLUME, as well at most one event is sent. In the event there are no AVS_SPEAKER_VOLUME speakers registered, no event will be sent. In addition, only AVS_SPEAKER_VOLUME speakers should be affected.

◆ TEST_P() [17/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_getSpeakerConfigDefaults   
)

Parameterized test for getSpeakerSettings. Operation should succeed with default speaker settings.

◆ TEST_P() [18/18]

alexaClientSDK::speakerManager::test::TEST_P ( SpeakerManagerTest  ,
test_getSpeakerConfigFromStorage   
)

Parameterized test for getSpeakerSettings. Operation should succeed with speaker settings from storage.

Variable Documentation

◆ INITIAL_SETTINGS

const SpeakerInterface::SpeakerSettings alexaClientSDK::speakerManager::test::INITIAL_SETTINGS {AVS_SET_VOLUME_MAX / 2, false}
static

Initial Settings for underlying SpeakerInterface.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0