diff options
Diffstat (limited to 'test/components/include')
5 files changed, 6 insertions, 49 deletions
diff --git a/test/components/include/protocol_handler/control_message_matcher.h b/test/components/include/protocol_handler/control_message_matcher.h index f392e4a200..70b4a573e1 100644 --- a/test/components/include/protocol_handler/control_message_matcher.h +++ b/test/components/include/protocol_handler/control_message_matcher.h @@ -34,7 +34,6 @@ #include <gmock/gmock.h> #include <string> -#include <vector> #include "protocol/raw_message.h" #include "protocol_handler/protocol_packet.h" @@ -52,14 +51,9 @@ MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption, // Nack shall be always with flag protected off DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ || !ExpectedEncryption); - const ::protocol_handler::RawMessagePtr message = arg; - ::protocol_handler::ProtocolPacket packet(message->connection_key()); - const protocol_handler::RESULT_CODE result = - packet.deserializePacket(message->data(), message->data_size()); - if (result != protocol_handler::RESULT_OK) { - *result_listener << "Error while message deserialization."; - return false; - } + const RawMessagePtr message = arg; + const ::protocol_handler::ProtocolPacket packet( + message->connection_key(), message->data(), message->data_size()); if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) { *result_listener << "Is not control message"; return false; @@ -96,39 +90,6 @@ MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption, } return true; } - -MATCHER_P2(ControlMessage, ExpectedFrameData, ExpectedEncryption, - (std::string(ExpectedEncryption ? "Protected" : "Unprotected") - + " control message ")) { - // Nack shall be always with flag protected off - DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ || - !ExpectedEncryption); - const ::protocol_handler::RawMessagePtr message = arg; - ::protocol_handler::ProtocolPacket packet(message->connection_key()); - const protocol_handler::RESULT_CODE result = - packet.deserializePacket(message->data(), message->data_size()); - if (result != protocol_handler::RESULT_OK) { - *result_listener << "Error while message deserialization."; - return false; - } - if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) { - *result_listener << "Is not control message"; - return false; - } - if (ExpectedFrameData != packet.frame_data()) { - *result_listener << "Control message with data 0x" - << std::hex << static_cast<int>(packet.frame_data()) - << ", not 0x" - << std::hex << static_cast<int>(ExpectedFrameData); - return false; - } - if (ExpectedEncryption != packet.protection_flag()) { - *result_listener << "Control message is " << - (ExpectedEncryption ? "" : "not ") << "protected"; - return false; - } - return true; -} } // namespace protocol_handler_test } // namespace components } // namespace test diff --git a/test/components/include/protocol_handler/protocol_handler_mock.h b/test/components/include/protocol_handler/protocol_handler_mock.h index d9e7759757..eac6ecf546 100644 --- a/test/components/include/protocol_handler/protocol_handler_mock.h +++ b/test/components/include/protocol_handler/protocol_handler_mock.h @@ -45,7 +45,7 @@ namespace protocol_handler_test { class ProtocolHandlerMock: public ::protocol_handler::ProtocolHandler { public: MOCK_METHOD2(SendMessageToMobileApp, - void(const ::protocol_handler::RawMessagePtr message, + void(const RawMessagePtr message, bool final_message)); MOCK_METHOD1(AddProtocolObserver, void(::protocol_handler::ProtocolObserver *observer)); diff --git a/test/components/include/protocol_handler/protocol_observer_mock.h b/test/components/include/protocol_handler/protocol_observer_mock.h index 9049c9db9b..6153216fff 100644 --- a/test/components/include/protocol_handler/protocol_observer_mock.h +++ b/test/components/include/protocol_handler/protocol_observer_mock.h @@ -47,9 +47,9 @@ namespace protocol_handler_test { class ProtocolObserverMock: public ::protocol_handler::ProtocolObserver { public: MOCK_METHOD1(OnMessageReceived, - void(const ::protocol_handler::RawMessagePtr)); + void(const RawMessagePtr)); MOCK_METHOD1(OnMobileMessageSent, - void(const ::protocol_handler::RawMessagePtr)); + void(const RawMessagePtr)); }; } // namespace protocol_handler_test } // namespace components diff --git a/test/components/include/protocol_handler/session_observer_mock.h b/test/components/include/protocol_handler/session_observer_mock.h index 91d9b40b3f..c2fe89cc95 100644 --- a/test/components/include/protocol_handler/session_observer_mock.h +++ b/test/components/include/protocol_handler/session_observer_mock.h @@ -58,8 +58,6 @@ class SessionObserverMock: public ::protocol_handler::SessionObserver { const uint8_t sessionId, const uint32_t &hashCode, const ::protocol_handler::ServiceType &service_type)); - MOCK_METHOD1(OnApplicationFloodCallBack, - void(const uint32_t&)); MOCK_METHOD2(KeyFromPair, uint32_t( transport_manager::ConnectionUID connection_handle, diff --git a/test/components/include/transport_manager/transport_manager_mock.h b/test/components/include/transport_manager/transport_manager_mock.h index eb8e9b4b53..db333b4da3 100644 --- a/test/components/include/transport_manager/transport_manager_mock.h +++ b/test/components/include/transport_manager/transport_manager_mock.h @@ -78,8 +78,6 @@ class TransportManagerMock: public ::transport_manager::TransportManager { int(const DeviceHandle &)); MOCK_CONST_METHOD1(Visibility, int(const bool &)); - MOCK_METHOD0(Reinit, - int()); }; } // namespace transport_manager_test } // namespace components |