diff options
author | Sergey Levchenko (GitHub) <slevchenko.work@gmail.com> | 2016-11-10 13:41:28 +0200 |
---|---|---|
committer | Sergey Levchenko (GitHub) <slevchenko.work@gmail.com> | 2016-11-18 09:48:57 +0200 |
commit | a56e4c776958acdde2edc5e16e25c58adfddd6d5 (patch) | |
tree | 2a2bbe0ce2a926818274529f8ae92c39aaae4b6c /src | |
parent | ef26e784de4589df2a80207537c7c13411c48769 (diff) | |
download | sdl_core-a56e4c776958acdde2edc5e16e25c58adfddd6d5.tar.gz |
Fix issue with MockHmiInterfaces
Added additional ON_CALLs for MockHmiInterfaces
Related to: APPLINK-29755
Diffstat (limited to 'src')
-rw-r--r-- | src/components/application_manager/test/include/application_manager/commands/commands_test.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h index 232b8fef0b..399b76e3f3 100644 --- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h @@ -42,22 +42,27 @@ #include "utils/make_shared.h" #include "application_manager/mock_application_manager.h" #include "test/application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_application.h" namespace test { namespace components { namespace commands_test { +namespace am = ::application_manager; + using ::testing::ReturnRef; +using ::testing::Return; using ::testing::NiceMock; +using ::testing::_; using ::utils::SharedPtr; using ::smart_objects::SmartObject; -using ::application_manager::commands::MessageSharedPtr; +using am::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; -using ::application_manager::ApplicationSharedPtr; +using am::ApplicationSharedPtr; using ::test::components::application_manager_test::MockApplication; // Depending on the value type will be selected @@ -93,7 +98,6 @@ class CommandsTest : public ::testing::Test { typedef typename TypeIf<kIsNice, NiceMock<MockApplication>, MockApplication>::Result MockApp; - typedef SharedPtr<MockApp> MockAppPtr; virtual ~CommandsTest() {} @@ -131,6 +135,7 @@ class CommandsTest : public ::testing::Test { MockAppManager app_mngr_; MockAppManagerSettings app_mngr_settings_; + MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; protected: virtual void InitCommand(const uint32_t& timeout) { @@ -140,7 +145,14 @@ class CommandsTest : public ::testing::Test { .WillByDefault(ReturnRef(timeout)); } - CommandsTest() {} + CommandsTest() { + ON_CALL(app_mngr_, hmi_interfaces()) + .WillByDefault(ReturnRef(mock_hmi_interfaces_)); + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) + .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL)); + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) + .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); + } }; } // namespace commands_test |