diff options
author | Alexander <AKutsan@luxoft.com> | 2016-04-28 18:44:37 +0300 |
---|---|---|
committer | Alexander <AKutsan@luxoft.com> | 2016-04-29 10:55:29 +0300 |
commit | 1b4c70d36520f98466d88b67f6722cb2fd79e7a7 (patch) | |
tree | ca2d2935153d935e89811b834dd96c64bc8a0421 | |
parent | 5b3112e229cbcca965817d4e1fea63819f5689bc (diff) | |
download | sdl_core-1b4c70d36520f98466d88b67f6722cb2fd79e7a7.tar.gz |
Format not formated files
9 files changed, 99 insertions, 62 deletions
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 98ee09badb..526ce6e672 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -464,9 +464,9 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { *hmi_capabilities.audio_pass_thru_capabilities(); } } - if (hmi_capabilities.pcm_stream_capabilities() ) { - response_params[strings::pcm_stream_capabilities] = - *hmi_capabilities.pcm_stream_capabilities(); + if (hmi_capabilities.pcm_stream_capabilities()) { + response_params[strings::pcm_stream_capabilities] = + *hmi_capabilities.pcm_stream_capabilities(); } if (hmi_capabilities.vehicle_type()) { response_params[hmi_response::vehicle_type] = diff --git a/src/components/application_manager/src/hmi_capabilities.cc b/src/components/application_manager/src/hmi_capabilities.cc index a0415ac34c..7535984c16 100644 --- a/src/components/application_manager/src/hmi_capabilities.cc +++ b/src/components/application_manager/src/hmi_capabilities.cc @@ -540,8 +540,8 @@ void HMICapabilities::set_pcm_stream_capabilities( if (pcm_stream_capabilities_) { delete pcm_stream_capabilities_; } - pcm_stream_capabilities_ = new smart_objects::SmartObject( - pcm_stream_capabilities); + pcm_stream_capabilities_ = + new smart_objects::SmartObject(pcm_stream_capabilities); } void HMICapabilities::set_preset_bank_capabilities( @@ -796,26 +796,22 @@ bool HMICapabilities::load_capabilities_from_file() { if (check_existing_json_member(ui, "pcmStreamCapabilities")) { Json::Value pcm_capabilities = ui.get("pcmStreamCapabilities", ""); smart_objects::SmartObject pcm_capabilities_so = - smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject(smart_objects::SmartType_Map); if (check_existing_json_member(pcm_capabilities, "samplingRate")) { pcm_capabilities_so["samplingRate"] = sampling_rate_enum.find(pcm_capabilities.get("samplingRate", "") - .asString()) - ->second; + .asString())->second; } if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) { pcm_capabilities_so["bitsPerSample"] = - bit_per_sample_enum.find( - pcm_capabilities.get("bitsPerSample", "") - .asString()) - ->second; + bit_per_sample_enum.find(pcm_capabilities.get("bitsPerSample", "") + .asString())->second; } if (check_existing_json_member(pcm_capabilities, "audioType")) { pcm_capabilities_so["audioType"] = audio_type_enum.find(pcm_capabilities.get("audioType", "") - .asString()) - ->second; + .asString())->second; } set_pcm_stream_capabilities(pcm_capabilities_so); diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h index 82116a164a..3ff1aa6eee 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h @@ -201,8 +201,8 @@ class TransportAdapter { * @param device_handle Device unique identifier. * @param app_handle Handle of application. */ - virtual void RemoveFinalizedConnection(const DeviceUID& device_handle, - const ApplicationHandle& app_handle) = 0; + virtual void RemoveFinalizedConnection( + const DeviceUID& device_handle, const ApplicationHandle& app_handle) = 0; /** * @brief Disconnect from specified session. diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h index 37c0f02a1a..3dedead540 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h @@ -143,8 +143,8 @@ class TransportAdapterImpl : public TransportAdapter, * @param device_handle Handle of device * @return Error information about connecting applications on device */ - TransportAdapter::Error ConnectDevice(const DeviceUID& device_handle) - OVERRIDE; + TransportAdapter::Error ConnectDevice( + const DeviceUID& device_handle) OVERRIDE; /** * @brief Disconnect from specified session. @@ -154,9 +154,9 @@ class TransportAdapterImpl : public TransportAdapter, * * @return Error information about possible reason of disconnecting failure. **/ - TransportAdapter::Error Disconnect(const DeviceUID& device_handle, - const ApplicationHandle& app_handle) - OVERRIDE; + TransportAdapter::Error Disconnect( + const DeviceUID& device_handle, + const ApplicationHandle& app_handle) OVERRIDE; /** * @brief Disconnect from all sessions on specified device. @@ -166,8 +166,8 @@ class TransportAdapterImpl : public TransportAdapter, * @return Error information about possible reason of disconnecting from *specified device failure. **/ - TransportAdapter::Error DisconnectDevice(const DeviceUID& device_handle) - OVERRIDE; + TransportAdapter::Error DisconnectDevice( + const DeviceUID& device_handle) OVERRIDE; /** * @brief Send frame of data. @@ -178,10 +178,10 @@ class TransportAdapterImpl : public TransportAdapter, * * @return Error information about possible reason of sending data failure **/ - TransportAdapter::Error SendData(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - const ::protocol_handler::RawMessagePtr data) - OVERRIDE; + TransportAdapter::Error SendData( + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr data) OVERRIDE; /** * @brief Start client listener. @@ -233,8 +233,8 @@ class TransportAdapterImpl : public TransportAdapter, * * @return Container(vector) that holds application unique identifiers. */ - ApplicationList GetApplicationList(const DeviceUID& device_handle) const - OVERRIDE; + ApplicationList GetApplicationList( + const DeviceUID& device_handle) const OVERRIDE; /** * @brief Find device in the internal container(map). diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc index d10013c0fe..5638eecdee 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc @@ -754,19 +754,19 @@ void TransportAdapterImpl::RemoveFinalizedConnection( const ApplicationHandle app_uid = app_handle; LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoWriteLock lock(connections_lock_); - ConnectionMap::iterator it_conn = connections_.find( - std::make_pair(device_uid, app_handle)); + ConnectionMap::iterator it_conn = + connections_.find(std::make_pair(device_uid, app_handle)); if (it_conn == connections_.end()) { - LOG4CXX_WARN( - logger_, - "Device_id: " << &device_uid << ", app_handle: " << &app_uid << " connection not found"); + LOG4CXX_WARN(logger_, + "Device_id: " << &device_uid << ", app_handle: " << &app_uid + << " connection not found"); return; } const ConnectionInfo& info = it_conn->second; if (info.state != ConnectionInfo::FINALISING) { - LOG4CXX_WARN( - logger_, - "Device_id: " << &device_uid << ", app_handle: " << &app_uid << " connection not finalized"); + LOG4CXX_WARN(logger_, + "Device_id: " << &device_uid << ", app_handle: " << &app_uid + << " connection not finalized"); return; } connections_.erase(it_conn); diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc index 04d685b726..113d280c8d 100644 --- a/src/components/transport_manager/src/transport_manager_impl.cc +++ b/src/components/transport_manager/src/transport_manager_impl.cc @@ -746,7 +746,8 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL: { const DeviceHandle device_handle = converter_.UidToHandle(event.device_uid); - RaiseEvent(&TransportManagerListener::OnDisconnectFailed, device_handle, + RaiseEvent(&TransportManagerListener::OnDisconnectFailed, + device_handle, DisconnectDeviceError()); LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_FAIL"); break; @@ -761,11 +762,12 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); - LOG4CXX_DEBUG(logger_, - "event_type = ON_SEND_DONE. Condition: NULL == connection"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id << ") not found"); + LOG4CXX_DEBUG( + logger_, + "event_type = ON_SEND_DONE. Condition: NULL == connection"); break; } RaiseEvent(&TransportManagerListener::OnTMMessageSend, event.event_data); @@ -785,12 +787,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { #endif // TELEMETRY_MONITOR { sync_primitives::AutoReadLock lock(connections_lock_); - ConnectionInternal* connection = GetConnection(event.device_uid, - event.application_id); + ConnectionInternal* connection = + GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR( - logger_, - "Connection ('" << event.device_uid << ", " << event.application_id << ") not found"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id + << ") not found"); LOG4CXX_DEBUG( logger_, "event_type = ON_SEND_FAIL. Condition: NULL == connection"); @@ -814,12 +817,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE: { { sync_primitives::AutoReadLock lock(connections_lock_); - ConnectionInternal* connection = GetConnection(event.device_uid, - event.application_id); + ConnectionInternal* connection = + GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR( - logger_, - "Connection ('" << event.device_uid << ", " << event.application_id << ") not found"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id + << ") not found"); LOG4CXX_DEBUG( logger_, "event_type = ON_RECEIVED_DONE. Condition: NULL == connection"); @@ -843,9 +847,9 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR( - logger_, - "Connection ('" << event.device_uid << ", " << event.application_id << ") not found"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id << ") not found"); connections_lock_.Release(); break; } @@ -957,7 +961,8 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( void TransportManagerImpl::ConnectionInternal::DisconnectFailedRoutine() { LOG4CXX_TRACE(logger_, "enter"); transport_manager->RaiseEvent(&TransportManagerListener::OnDisconnectFailed, - device_handle_, DisconnectDeviceError()); + device_handle_, + DisconnectDeviceError()); shutdown_ = false; timer->Stop(); LOG4CXX_TRACE(logger_, "exit"); diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h index 44175593bc..d12741f49a 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h @@ -73,9 +73,9 @@ class MockTransportAdapter MOCK_METHOD0( StopClientListening, ::transport_manager::transport_adapter::TransportAdapter::Error()); - MOCK_METHOD2(RemoveFinalizedConnection, void( - const ::transport_manager::DeviceUID& device_handle, - const ::transport_manager::ApplicationHandle& app_handle)); + MOCK_METHOD2(RemoveFinalizedConnection, + void(const ::transport_manager::DeviceUID& device_handle, + const ::transport_manager::ApplicationHandle& app_handle)); MOCK_METHOD2(Disconnect, ::transport_manager::transport_adapter::TransportAdapter::Error( const ::transport_manager::DeviceUID& device_handle, diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc index e7324376f9..ddfd827358 100644 --- a/src/components/transport_manager/test/transport_manager_impl_test.cc +++ b/src/components/transport_manager/test/transport_manager_impl_test.cc @@ -285,7 +285,8 @@ class TransportManagerImplTest : public ::testing::Test { error_); EXPECT_CALL(*tm_listener_, OnConnectionClosed(application_id_)); - EXPECT_CALL(*mock_adapter_, RemoveFinalizedConnection(mac_address_, application_id_)); + EXPECT_CALL(*mock_adapter_, + RemoveFinalizedConnection(mac_address_, application_id_)); tm_.TestHandle(test_event); } @@ -773,7 +774,8 @@ TEST_F(TransportManagerImplTest, CheckUnexpectedDisconnect) { HandleConnection(); // Act and Assert EXPECT_CALL(*tm_listener_, OnUnexpectedDisconnect(connection_key_, _)); - EXPECT_CALL(*mock_adapter_, RemoveFinalizedConnection(mac_address_, application_id_)); + EXPECT_CALL(*mock_adapter_, + RemoveFinalizedConnection(mac_address_, application_id_)); tm_.TestHandle(test_event); } diff --git a/tools/Utils/fix_style_in_project.sh b/tools/Utils/fix_style_in_project.sh new file mode 100755 index 0000000000..bf7403d2a3 --- /dev/null +++ b/tools/Utils/fix_style_in_project.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh +# Copyright (c) 2016 Ford Motor Company, +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the name of Ford Motor Company nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FILE_NAMES=$(find src -name \*.h -print -o -name \*.cpp -print -o -name \*.cc -print | grep -v 3rd_party) +for FILE_NAME in $FILE_NAMES +do + clang-format-3.6 -style=file -i $FILE_NAME +done |