diff options
Diffstat (limited to 'src/components/protocol_handler')
17 files changed, 151 insertions, 142 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h index 4633be6c6e..82bf563bc5 100644 --- a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h +++ b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h @@ -34,9 +34,9 @@ #include <map> #include <vector> -#include "utils/macro.h" #include "protocol_handler/protocol_packet.h" #include "transport_manager/common.h" +#include "utils/macro.h" namespace protocol_handler { diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h index 84ec3c9e30..3da63bd79f 100644 --- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h +++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h @@ -33,13 +33,13 @@ #ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_ #define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_ -#include <map> -#include <ostream> // std::basic_ostream -#include <iterator> // std::ostream_iterator #include <algorithm> // std::copy +#include <iterator> // std::ostream_iterator +#include <map> +#include <ostream> // std::basic_ostream -#include "utils/date_time.h" #include "protocol_handler/protocol_packet.h" +#include "utils/date_time.h" /** *\namespace protocol_handlerHandler @@ -86,36 +86,36 @@ typedef std::map<ConnectionID, SessionToFrameMap> MultiFrameMap; class MultiFrameBuilder { public: /** - * @brief Constructor - */ + * @brief Constructor + */ MultiFrameBuilder(); /** - *\brief Set timeout of waiting CONSECUTIVE frames - */ + *\brief Set timeout of waiting CONSECUTIVE frames + */ void set_waiting_timeout(const uint32_t consecutive_frame_wait_msecs); /** - * @brief Add connection for pending data - * @return true on success - */ + * @brief Add connection for pending data + * @return true on success + */ bool AddConnection(const ConnectionID connection_id); /** - * @brief Clear all data related to connection_id - * @return true on success - */ + * @brief Clear all data related to connection_id + * @return true on success + */ bool RemoveConnection(const ConnectionID connection_id); /** - *\brief Pop assembled and expired frames - */ + *\brief Pop assembled and expired frames + */ ProtocolFramePtrList PopMultiframes(); /** - *\brief Handle Single or Consecutive frame - * @return RESULT_OK on success, or RESULT_FAIL in case of any error - */ + *\brief Handle Single or Consecutive frame + * @return RESULT_OK on success, or RESULT_FAIL in case of any error + */ RESULT_CODE AddFrame(const ProtocolFramePtr packet); private: diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index 7c2b411dcb..15996bb4e2 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -33,33 +33,33 @@ #ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_ #define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_ +#include <stdint.h> #include <map> #include <memory> #include <set> -#include <stdint.h> #include <utility> // std::make_pair #include <vector> -#include "utils/prioritized_queue.h" #include "utils/message_queue.h" +#include "utils/prioritized_queue.h" #include "utils/threads/message_loop_thread.h" -#include "utils/messagemeter.h" #include "utils/custom_string.h" +#include "utils/messagemeter.h" #include "utils/semantic_version.h" +#include "application_manager/policies/policy_handler_observer.h" +#include "connection_handler/connection_handler.h" +#include "protocol_handler/incoming_data_handler.h" +#include "protocol_handler/multiframe_builder.h" #include "protocol_handler/protocol_handler.h" -#include "protocol_handler/protocol_packet.h" #include "protocol_handler/protocol_handler_settings.h" -#include "protocol_handler/session_observer.h" #include "protocol_handler/protocol_observer.h" -#include "protocol_handler/incoming_data_handler.h" -#include "protocol_handler/multiframe_builder.h" +#include "protocol_handler/protocol_packet.h" +#include "protocol_handler/session_observer.h" #include "transport_manager/common.h" +#include "transport_manager/transport_adapter/transport_adapter.h" #include "transport_manager/transport_manager.h" #include "transport_manager/transport_manager_listener_empty.h" -#include "transport_manager/transport_adapter/transport_adapter.h" -#include "connection_handler/connection_handler.h" -#include "application_manager/policies/policy_handler_observer.h" #ifdef TELEMETRY_MONITOR #include "protocol_handler/telemetry_observer.h" @@ -67,8 +67,8 @@ #endif // TELEMETRY_MONITOR #ifdef ENABLE_SECURITY -#include "security_manager/security_manager.h" #include "protocol_handler/handshake_handler.h" +#include "security_manager/security_manager.h" #endif // ENABLE_SECURITY namespace connection_handler { @@ -110,7 +110,8 @@ struct RawFordMessageFromMobile : public ProtocolFramePtr { // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return MessagePriority::FromServiceType( - ServiceTypeFromByte(get()->service_type())).OrderingValue(); + ServiceTypeFromByte(get()->service_type())) + .OrderingValue(); } }; @@ -122,7 +123,8 @@ struct RawFordMessageToMobile : public ProtocolFramePtr { // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return MessagePriority::FromServiceType( - ServiceTypeFromByte(get()->service_type())).OrderingValue(); + ServiceTypeFromByte(get()->service_type())) + .OrderingValue(); } // Signals whether connection to mobile must be closed after processing this // message @@ -131,9 +133,11 @@ struct RawFordMessageToMobile : public ProtocolFramePtr { // Short type names for prioritized message queues typedef threads::MessageLoopThread< - utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue; + utils::PrioritizedQueue<RawFordMessageFromMobile> > + FromMobileQueue; typedef threads::MessageLoopThread< - utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue; + utils::PrioritizedQueue<RawFordMessageToMobile> > + ToMobileQueue; // Type to allow easy mapping between a device type and transport // characteristics @@ -176,10 +180,10 @@ class ProtocolHandlerImpl public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler #ifdef TELEMETRY_MONITOR - , + , public telemetry_monitor::TelemetryObservable<PHTelemetryObserver> #endif // TELEMETRY_MONITOR - { +{ public: /** * @brief Constructor @@ -252,20 +256,20 @@ class ProtocolHandlerImpl void SendHeartBeat(int32_t connection_id, uint8_t session_id); /** - * \brief Sends ending session to mobile application - * \param connection_id Identifier of connection within which - * session exists - * \param session_id ID of session to be ended - */ + * \brief Sends ending session to mobile application + * \param connection_id Identifier of connection within which + * session exists + * \param session_id ID of session to be ended + */ void SendEndSession(int32_t connection_id, uint8_t session_id); /** - * \brief Sends ending session to mobile application - * \param primary_connection_id Identifier of connection within which - * service exists - * \param connection_id Identifier of the actual transport for the service - * \param session_id ID of session to be ended - */ + * \brief Sends ending session to mobile application + * \param primary_connection_id Identifier of connection within which + * service exists + * \param connection_id Identifier of the actual transport for the service + * \param session_id ID of session to be ended + */ void SendEndService(int32_t primary_connection_id, int32_t connection_id, uint8_t session_id, diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index de4af84915..215c63c685 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -34,9 +34,9 @@ #define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_ #include <list> -#include "utils/macro.h" #include "protocol/common.h" #include "transport_manager/common.h" +#include "utils/macro.h" /** *\namespace protocol_handlerHandler @@ -275,8 +275,8 @@ class ProtocolPacket { /*End of Deserialization*/ /** - * \brief Getter for Connection Identifier - */ + * \brief Getter for Connection Identifier + */ ConnectionID connection_id() const; /** @@ -285,13 +285,13 @@ class ProtocolPacket { void set_connection_id(ConnectionID connection_id); /** - * \brief Getter for data payload size - */ + * \brief Getter for data payload size + */ uint32_t payload_size() const; /** - * \brief Getter for full header information - */ + * \brief Getter for full header information + */ const ProtocolHeader& packet_header() const; private: @@ -311,9 +311,9 @@ class ProtocolPacket { uint32_t payload_size_; /** - * \brief Connection Identifier - * Obtained from connection_handler - */ + * \brief Connection Identifier + * Obtained from connection_handler + */ ConnectionID connection_id_; DISALLOW_COPY_AND_ASSIGN(ProtocolPacket); diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc index 775d77db66..fa0b375018 100644 --- a/src/components/protocol_handler/src/handshake_handler.cc +++ b/src/components/protocol_handler/src/handshake_handler.cc @@ -36,8 +36,8 @@ #include "protocol_handler/protocol_handler_impl.h" #include "protocol_handler/protocol_packet.h" -#include "security_manager/security_manager.h" #include "protocol_handler/session_observer.h" +#include "security_manager/security_manager.h" namespace protocol_handler { diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc index 4944ea9cc7..566b36f46d 100644 --- a/src/components/protocol_handler/src/incoming_data_handler.cc +++ b/src/components/protocol_handler/src/incoming_data_handler.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "protocol_handler/incoming_data_handler.h" -#include "utils/logger.h" #include "protocol/common.h" +#include "utils/logger.h" namespace protocol_handler { diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc index c34e2ec640..d7cfc6f90e 100644 --- a/src/components/protocol_handler/src/multiframe_builder.cc +++ b/src/components/protocol_handler/src/multiframe_builder.cc @@ -36,8 +36,8 @@ #include "utils/logger.h" -#include "utils/lock.h" #include "utils/date_time.h" +#include "utils/lock.h" namespace protocol_handler { diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 944d80d5d9..e0768b3adf 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -32,20 +32,20 @@ #include "protocol_handler/protocol_handler_impl.h" #include <arpa/inet.h> // for INET6_ADDRSTRLEN -#include <memory.h> -#include <algorithm> // std::find #include <bson_object.h> +#include <memory.h> #include <protocol/bson_object_keys.h> +#include <algorithm> // std::find #include "connection_handler/connection_handler_impl.h" +#include "protocol/common.h" #include "protocol_handler/session_observer.h" #include "utils/byte_order.h" #include "utils/helpers.h" -#include "protocol/common.h" #ifdef ENABLE_SECURITY -#include "security_manager/ssl_context.h" #include "security_manager/security_manager.h" +#include "security_manager/ssl_context.h" #endif // ENABLE_SECURITY namespace protocol_handler { @@ -975,9 +975,9 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) { LOG4CXX_DEBUG(logger_, "Proccessed " << protocol_frames.size() << " frames"); if (result != RESULT_OK) { if (result == RESULT_MALFORMED_OCCURS) { - LOG4CXX_WARN(logger_, - "Malformed message occurs, connection id " - << connection_key); + LOG4CXX_WARN( + logger_, + "Malformed message occurs, connection id " << connection_key); if (!get_settings().malformed_message_filtering()) { LOG4CXX_DEBUG(logger_, "Malformed message filterign disabled"); session_observer_.OnMalformedMessageCallback(connection_key); @@ -1285,9 +1285,9 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage( const bool is_final_message) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - " data size " << data_size << " max_frame_size " - << max_frame_size); + LOG4CXX_DEBUG( + logger_, + " data size " << data_size << " max_frame_size " << max_frame_size); // remainder of last frame const size_t lastframe_remainder = data_size % max_frame_size; @@ -1880,9 +1880,9 @@ void ProtocolHandlerImpl::NotifySessionStarted( RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( const ProtocolPacket& packet) { const ConnectionID connection_id = packet.connection_id(); - LOG4CXX_DEBUG(logger_, - "Sending heart beat acknowledgment for connection " - << connection_id); + LOG4CXX_DEBUG( + logger_, + "Sending heart beat acknowledgment for connection " << connection_id); uint8_t protocol_version; if (session_observer_.ProtocolVersionUsed( connection_id, packet.session_id(), protocol_version)) { @@ -1918,9 +1918,9 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() { const uint32_t connection_key = session_observer_.KeyFromPair( frame->connection_id(), frame->session_id()); - LOG4CXX_DEBUG(logger_, - "Result frame" << frame << "for connection " - << connection_key); + LOG4CXX_DEBUG( + logger_, + "Result frame" << frame << "for connection " << connection_key); const RawMessagePtr rawMessage(new RawMessage(connection_key, frame->protocol_version(), frame->data(), @@ -1947,9 +1947,9 @@ bool ProtocolHandlerImpl::TrackMessage(const uint32_t& connection_key) { if (frequency_time > 0u && frequency_count > 0u) { const size_t message_frequency = message_meter_.TrackMessage(connection_key); - LOG4CXX_DEBUG(logger_, - "Frequency of " << connection_key << " is " - << message_frequency); + LOG4CXX_DEBUG( + logger_, + "Frequency of " << connection_key << " is " << message_frequency); if (message_frequency > frequency_count) { LOG4CXX_WARN(logger_, "Frequency of " << connection_key << " is marked as high."); @@ -1975,9 +1975,9 @@ bool ProtocolHandlerImpl::TrackMalformedMessage(const uint32_t& connection_key, << malformed_message_frequency); if (!get_settings().malformed_message_filtering() || malformed_message_frequency > malformed_frequency_count) { - LOG4CXX_WARN(logger_, - "Malformed frequency of " << connection_key - << " is marked as high."); + LOG4CXX_WARN( + logger_, + "Malformed frequency of " << connection_key << " is marked as high."); session_observer_.OnMalformedMessageCallback(connection_key); malformed_message_meter_.RemoveIdentifier(connection_key); return true; @@ -2027,7 +2027,8 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) { "Message to mobile app: connection id " << static_cast<int>(message->connection_id()) << ";" - " dataSize: " << message->data_size() + " dataSize: " + << message->data_size() << " ;" " protocolVersion " << static_cast<int>(message->protocol_version())); @@ -2432,9 +2433,9 @@ void ProtocolHandlerImpl::GenerateServiceTransportsForStartSessionAck( std::vector<std::string>::const_iterator it = service_transports.begin(); for (; it != service_transports.end(); it++) { const utils::custom_string::CustomString transport(*it); - LOG4CXX_TRACE(logger_, - "Service Allowed to run on " << transport.c_str() - << " transport"); + LOG4CXX_TRACE( + logger_, + "Service Allowed to run on " << transport.c_str() << " transport"); if (!fPrimaryAdded && (transport.CompareIgnoreCase(primary_connection_type.c_str()) || diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc index d5422e11bc..3473b8e5c5 100644 --- a/src/components/protocol_handler/src/protocol_packet.cc +++ b/src/components/protocol_handler/src/protocol_packet.cc @@ -30,17 +30,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <stdint.h> #include <memory.h> -#include <new> -#include <memory> +#include <stdint.h> #include <cstring> #include <limits> +#include <memory> +#include <new> #include "protocol/common.h" #include "protocol_handler/protocol_packet.h" -#include "utils/macro.h" #include "utils/byte_order.h" +#include "utils/macro.h" #include "utils/semantic_version.h" namespace protocol_handler { @@ -118,9 +118,9 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message, case PROTOCOL_VERSION_4: case PROTOCOL_VERSION_5: { if (messageSize < PROTOCOL_HEADER_V2_SIZE) { - LOG4CXX_DEBUG(logger_, - "Message size less " << PROTOCOL_HEADER_V2_SIZE - << " bytes"); + LOG4CXX_DEBUG( + logger_, + "Message size less " << PROTOCOL_HEADER_V2_SIZE << " bytes"); return; } messageId = read_be_uint32(message + 8); @@ -255,9 +255,9 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate( // ServiceType shall be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B // (Video), 0x0F (Bulk) if (ServiceTypeFromByte(header.serviceType) == kInvalidServiceType) { - LOG4CXX_WARN(logger_, - "Invalide service type" - << static_cast<int>(header.serviceType)); + LOG4CXX_WARN( + logger_, + "Invalide service type" << static_cast<int>(header.serviceType)); return RESULT_FAIL; } // Check frame info for each frame type diff --git a/src/components/protocol_handler/src/protocol_payload.cc b/src/components/protocol_handler/src/protocol_payload.cc index aa011bdf0f..8916fe91b0 100644 --- a/src/components/protocol_handler/src/protocol_payload.cc +++ b/src/components/protocol_handler/src/protocol_payload.cc @@ -44,7 +44,7 @@ static const size_t kCorrelationIdBits = 32; static const size_t kJsonSizeBits = 32; static const size_t PayloadHeaderBits = kRpcTypeBits + kRpcFunctionIdBits + kCorrelationIdBits + kJsonSizeBits; -} +} // namespace namespace protocol_handler { diff --git a/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h b/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h index 8f68003ada..a099cff225 100644 --- a/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h +++ b/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h @@ -32,10 +32,10 @@ #ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_ #define SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_ -#include "gmock/gmock.h" #include <ios> #include <string> #include <vector> +#include "gmock/gmock.h" #include "protocol/raw_message.h" #include "protocol_handler/protocol_packet.h" @@ -43,11 +43,11 @@ namespace test { namespace components { namespace protocol_handler_test { +using protocol_handler::FRAME_DATA_START_SERVICE_NACK; +using protocol_handler::FRAME_TYPE_CONTROL; using protocol_handler::ProtocolPacket; using protocol_handler::RawMessagePtr; using protocol_handler::RESULT_CODE; -using protocol_handler::FRAME_TYPE_CONTROL; -using protocol_handler::FRAME_DATA_START_SERVICE_NACK; bool CheckRegularMatches(const ProtocolPacket& packet, RESULT_CODE result, diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc index 9abf5d69af..fff102dde9 100644 --- a/src/components/protocol_handler/test/incoming_data_handler_test.cc +++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc @@ -30,11 +30,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <gtest/gtest.h> -#include <vector> #include <list> +#include <vector> -#include "utils/macro.h" #include "protocol_handler/incoming_data_handler.h" +#include "utils/macro.h" namespace test { namespace components { @@ -91,7 +91,7 @@ class IncomingDataHandlerTest : public ::testing::Test { FrameList actual_frames; RESULT_CODE result_code; size_t malformed_occurs; - uint8_t* some_data, *some_data2; + uint8_t *some_data, *some_data2; size_t some_data_size, some_data2_size; uint32_t protov1_message_id; uint32_t some_message_id; @@ -251,8 +251,8 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { it != actual_frames.end(); ++it, ++it_exp) { // TODO(EZamakhov): investigate valgrind warning (unitialized value) - EXPECT_EQ(**it, **it_exp) << "Element number " - << std::distance(mobile_packets.begin(), it_exp); + EXPECT_EQ(**it, **it_exp) + << "Element number " << std::distance(mobile_packets.begin(), it_exp); } } @@ -654,8 +654,8 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { it != actual_frames.end(); ++it, ++it_exp) { // TODO(EZamakhov): investigate valgrind warning (unitialized value) - EXPECT_EQ(**it, **it_exp) << "Element number " - << std::distance(mobile_packets.begin(), it_exp); + EXPECT_EQ(**it, **it_exp) + << "Element number " << std::distance(mobile_packets.begin(), it_exp); } } @@ -754,8 +754,8 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { it != actual_frames.end(); ++it, ++it_exp) { // TODO(EZamakhov): investigate valgrind warning (unitialized value) - EXPECT_EQ(**it, **it_exp) << "Element number " - << std::distance(mobile_packets.begin(), it_exp); + EXPECT_EQ(**it, **it_exp) + << "Element number " << std::distance(mobile_packets.begin(), it_exp); } } diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc index f919ec92af..2859aeb8ae 100644 --- a/src/components/protocol_handler/test/multiframe_builder_test.cc +++ b/src/components/protocol_handler/test/multiframe_builder_test.cc @@ -29,12 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include <vector> -#include <map> #include <algorithm> -#include <utility> #include <limits> +#include <map> +#include <utility> +#include <vector> +#include "gtest/gtest.h" #include "protocol_handler/multiframe_builder.h" diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index e1149fefb2..e23223c2c8 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -214,9 +214,11 @@ class ProtocolHandlerImplTest : public ::testing::Test { void TearDown() OVERRIDE { const_cast<protocol_handler::impl::FromMobileQueue&>( - protocol_handler_impl->get_from_mobile_queue()).WaitDumpQueue(); + protocol_handler_impl->get_from_mobile_queue()) + .WaitDumpQueue(); const_cast<protocol_handler::impl::ToMobileQueue&>( - protocol_handler_impl->get_to_mobile_queue()).WaitDumpQueue(); + protocol_handler_impl->get_to_mobile_queue()) + .WaitDumpQueue(); } // Emulate connection establish @@ -3638,7 +3640,8 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL, FRAME_DATA_HEART_BEAT_ACK, PROTECTION_OFF, - kControl))).Times(0); + kControl))) + .Times(0); // Act SendControlMessage( PROTECTION_OFF, kControl, session_id, FRAME_DATA_HEART_BEAT); @@ -3828,7 +3831,8 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) { SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL, FRAME_DATA_SERVICE_DATA_ACK, PROTECTION_OFF, - kMobileNav))).Times(0); + kMobileNav))) + .Times(0); protocol_handler_impl->SendFramesNumber(connection_key, 0); diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc index 5554bfd280..e69e44dbac 100644 --- a/src/components/protocol_handler/test/protocol_header_validator_test.cc +++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc @@ -31,11 +31,11 @@ */ #include <gtest/gtest.h> -#include <vector> #include <list> +#include <vector> -#include "utils/macro.h" #include "protocol_handler/protocol_packet.h" +#include "utils/macro.h" namespace { const size_t MAXIMUM_FRAME_DATA_V3_SIZE = 131072; diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc index 71c7726243..e4ea4be61f 100644 --- a/src/components/protocol_handler/test/protocol_packet_test.cc +++ b/src/components/protocol_handler/test/protocol_packet_test.cc @@ -30,42 +30,42 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include <vector> +#include "gtest/gtest.h" -#include "utils/macro.h" -#include "protocol_handler/protocol_packet.h" #include "protocol/common.h" +#include "protocol_handler/protocol_packet.h" +#include "utils/macro.h" namespace test { namespace components { namespace protocol_handler_test { -using protocol_handler::RawMessagePtr; -using protocol_handler::ProtocolPacket; using protocol_handler::ConnectionID; -using protocol_handler::FRAME_TYPE_MAX_VALUE; using protocol_handler::FRAME_DATA_FIRST; -using protocol_handler::FRAME_TYPE_FIRST; -using protocol_handler::PROTOCOL_VERSION_1; -using protocol_handler::PROTOCOL_VERSION_3; -using protocol_handler::PROTECTION_OFF; -using protocol_handler::RESULT_CODE; -using protocol_handler::RESULT_OK; -using protocol_handler::RESULT_FAIL; +using protocol_handler::FRAME_DATA_HEART_BEAT; +using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE; +using protocol_handler::FRAME_DATA_START_SERVICE_ACK; using protocol_handler::FRAME_TYPE_CONTROL; -using protocol_handler::kControl; -using protocol_handler::kRpc; +using protocol_handler::FRAME_TYPE_FIRST; +using protocol_handler::FRAME_TYPE_MAX_VALUE; using protocol_handler::kAudio; -using protocol_handler::kMobileNav; using protocol_handler::kBulk; +using protocol_handler::kControl; using protocol_handler::kInvalidServiceType; -using protocol_handler::FRAME_DATA_HEART_BEAT; -using protocol_handler::FRAME_DATA_START_SERVICE_ACK; -using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE; +using protocol_handler::kMobileNav; +using protocol_handler::kRpc; +using protocol_handler::PROTECTION_OFF; using protocol_handler::PROTOCOL_HEADER_V1_SIZE; using protocol_handler::PROTOCOL_HEADER_V2_SIZE; +using protocol_handler::PROTOCOL_VERSION_1; +using protocol_handler::PROTOCOL_VERSION_3; using protocol_handler::PROTOCOL_VERSION_MAX; +using protocol_handler::ProtocolPacket; +using protocol_handler::RawMessagePtr; +using protocol_handler::RESULT_CODE; +using protocol_handler::RESULT_FAIL; +using protocol_handler::RESULT_OK; class ProtocolPacketTest : public ::testing::Test { protected: diff --git a/src/components/protocol_handler/test/protocol_payload_test.cc b/src/components/protocol_handler/test/protocol_payload_test.cc index e56f8aadff..e89e6c7395 100644 --- a/src/components/protocol_handler/test/protocol_payload_test.cc +++ b/src/components/protocol_handler/test/protocol_payload_test.cc @@ -33,10 +33,10 @@ #include <gtest/gtest.h> #include <vector> -#include "utils/macro.h" -#include "utils/bitstream.h" -#include "protocol_handler/protocol_payload.h" #include "protocol/common.h" +#include "protocol_handler/protocol_payload.h" +#include "utils/bitstream.h" +#include "utils/macro.h" namespace test { namespace components { |