diff options
Diffstat (limited to 'src/components/policy/policy_regular')
24 files changed, 183 insertions, 185 deletions
diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index c4de9b7e1f..c0df6b729f 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -32,9 +32,9 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_ -#include <vector> #include <ostream> #include <string> +#include <vector> #include "policy/policy_table/types.h" #include "policy/policy_types.h" diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 840b706c8b..30732f685c 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -35,15 +35,15 @@ #include <map> +#include "policy/cache_manager_interface.h" #include "policy/pt_representation.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/cache_manager_interface.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/lock.h" -#include "utils/conditional_variable.h" #include "policy/policy_types.h" +#include "utils/conditional_variable.h" +#include "utils/lock.h" namespace policy { class PolicySettings; @@ -244,7 +244,7 @@ class CacheManager : public CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const; diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 2c14fd8cba..da15a4ecab 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -36,10 +36,10 @@ #include <string> #include <vector> -#include "policy/usage_statistics/counter.h" -#include "policy/policy_types.h" #include "policy/policy_settings.h" #include "policy/policy_table/types.h" +#include "policy/policy_types.h" +#include "policy/usage_statistics/counter.h" namespace policy_table = rpc::policy_table_interface_base; @@ -250,7 +250,7 @@ class CacheManagerInterface { * @brief Check if an app can send unknown rpc requests to an app service * provider * @param policy_app_id Unique application id - */ + */ virtual bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const = 0; @@ -460,10 +460,10 @@ class CacheManagerInterface { std::string& default_hmi) const = 0; /** - * Gets HMI types from specific policy - * @param app_id ID application - * @return list of HMI types - */ + * Gets HMI types from specific policy + * @param app_id ID application + * @return list of HMI types + */ virtual const policy_table::AppHMITypes* GetHMITypes( const std::string& app_id) = 0; diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h index 3ca0f93ebd..4c697858f5 100644 --- a/src/components/policy/policy_regular/include/policy/policy_helper.h +++ b/src/components/policy/policy_regular/include/policy/policy_helper.h @@ -246,6 +246,6 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first, * @return true, if succeded, otherwise - false */ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies); -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_ diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 911ce65a11..1860f7e591 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -33,21 +33,21 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ -#include <string> -#include <list> #include <cstdint> +#include <list> +#include <string> -#include "utils/lock.h" +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#include "policy/cache_manager_interface.h" +#include "policy/policy_helper.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" -#include "policy/cache_manager_interface.h" -#include "policy/update_status_manager.h" #include "policy/policy_table/functions.h" +#include "policy/update_status_manager.h" #include "policy/usage_statistics/statistics_manager.h" -#include "policy/policy_helper.h" +#include "utils/lock.h" #include "utils/timer.h" -#include "policy/access_remote.h" -#include "policy/access_remote_impl.h" namespace policy_table = rpc::policy_table_interface_base; @@ -672,7 +672,7 @@ class PolicyManagerImpl : public PolicyManager { * provider * @param policy_app_id Unique application id * @return bool true if allowed - */ + */ bool UnknownRPCPassthroughAllowed( const std::string& policy_app_id) const OVERRIDE; @@ -958,11 +958,11 @@ class PolicyManagerImpl : public PolicyManager { void SendAuthTokenUpdated(const std::string policy_app_id); /** - * @brief Gets all allowed module types - * @param policy_app_id unique identifier of application - * @param modules list of allowed module types - * @return true if application has allowed modules - */ + * @brief Gets all allowed module types + * @param policy_app_id unique identifier of application + * @param modules list of allowed module types + * @return true if application has allowed modules + */ bool GetModuleTypes(const std::string& policy_app_id, std::vector<std::string>* modules) const OVERRIDE; diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h index 276a0a5dca..0be5919126 100644 --- a/src/components/policy/policy_regular/include/policy/policy_types.h +++ b/src/components/policy/policy_regular/include/policy/policy_types.h @@ -34,15 +34,15 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_ #include <algorithm> -#include <string> -#include <vector> #include <map> +#include <memory> #include <set> +#include <string> #include <utility> -#include <memory> +#include <vector> -#include "utils/helpers.h" #include "transport_manager/common.h" +#include "utils/helpers.h" namespace policy { @@ -119,10 +119,10 @@ typedef std::vector<std::string> StringArray; enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed }; /** - * @struct Stores result of check: - * if HMI Level was allowed for RPC to work in - * and list of parameters allowed for RPC if specified in PT. - */ + * @struct Stores result of check: + * if HMI Level was allowed for RPC to work in + * and list of parameters allowed for RPC if specified in PT. + */ struct CheckPermissionResult { CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {} diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h index 378a294532..0534b27093 100644 --- a/src/components/policy/policy_regular/include/policy/pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/pt_representation.h @@ -33,12 +33,12 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_ -#include <vector> -#include <string> #include <memory> -#include "policy/policy_types.h" -#include "policy/policy_table/types.h" +#include <string> +#include <vector> #include "policy/policy_settings.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" #include "utils/macro.h" namespace policy { @@ -265,10 +265,10 @@ class PTRepresentation { virtual bool IsDefaultPolicy(const std::string& app_id) const = 0; /** - * Checks if the application has pre_data policy - * @param app_id application id - * @return true if application has pre_data policy - */ + * Checks if the application has pre_data policy + * @param app_id application id + * @return true if application has pre_data policy + */ virtual bool IsPredataPolicy(const std::string& app_id) const = 0; /** diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index dfa318454b..e95620fbc2 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -35,9 +35,9 @@ #include <string> #include <vector> +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h index c1ea2de4c1..8fd3ff559e 100644 --- a/src/components/policy/policy_regular/include/policy/status.h +++ b/src/components/policy/policy_regular/include/policy/status.h @@ -75,41 +75,41 @@ class Status { const policy::PolicyTableStatus enum_status); /** - * @brief Destructor - */ + * @brief Destructor + */ virtual ~Status(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ virtual void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) = 0; /** - * @brief Return current status as string value - * @return Status as string - */ + * @brief Return current status as string value + * @return Status as string + */ virtual const std::string get_status_string() const; /** - * @brief Return status as enum value - * @return Status as enum value - */ + * @brief Return status as enum value + * @return Status as enum value + */ virtual PolicyTableStatus get_status() const; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ virtual bool IsUpdateRequired() const; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ virtual bool IsUpdatePending() const; private: @@ -128,11 +128,11 @@ class UpToDateStatus : public Status { UpToDateStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; }; @@ -148,18 +148,18 @@ class UpdateNeededStatus : public Status { UpdateNeededStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; }; @@ -174,26 +174,26 @@ class UpdatingStatus : public Status { UpdatingStatus(); /** - * @brief Process event by setting next status in case event can affect - * current status or ignores the event - * @param manager Status manager pointer - * @param event Event which needs to be processed - */ + * @brief Process event by setting next status in case event can affect + * current status or ignores the event + * @param manager Status manager pointer + * @param event Event which needs to be processed + */ void ProcessEvent(UpdateStatusManagerInterface* manager, UpdateEvent event) OVERRIDE; /** - * @brief Check whether update is required in terms of status - * @return True if update is required, otherwise - false - */ + * @brief Check whether update is required in terms of status + * @return True if update is required, otherwise - false + */ bool IsUpdateRequired() const OVERRIDE; /** - * @brief Check whether update is pending in terms of status - * @return True if update is pending, otherwise - false - */ + * @brief Check whether update is pending in terms of status + * @return True if update is pending, otherwise - false + */ bool IsUpdatePending() const OVERRIDE; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_ diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h index c90acd4957..0c79bf0ba4 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h @@ -33,15 +33,14 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ -#include "policy/update_status_manager_interface.h" #include "policy/policy_types.h" -#include "utils/lock.h" -#include "utils/threads/thread.h" -#include "utils/threads/thread_delegate.h" +#include "policy/update_status_manager_interface.h" #include "utils/conditional_variable.h" #include "utils/lock.h" #include "utils/logger.h" #include "utils/macro.h" +#include "utils/threads/thread.h" +#include "utils/threads/thread_delegate.h" namespace policy { @@ -216,6 +215,6 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { bool app_registered_from_non_consented_device_; sync_primitives::Lock apps_search_in_progress_lock_; }; -} +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_ diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h index 72ae5fd9e0..bd88815012 100644 --- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h +++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h @@ -34,11 +34,11 @@ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_ #include <ctime> -#include "policy/usage_statistics/statistics_manager.h" #include "policy/usage_statistics/app_stopwatch.h" +#include "policy/usage_statistics/statistics_manager.h" -#include "utils/timer.h" #include "utils/macro.h" +#include "utils/timer.h" namespace usage_statistics { diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 2556a07709..94ce52b6f1 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -33,19 +33,19 @@ #include "policy/cache_manager.h" #include <algorithm> -#include <functional> -#include <ctime> #include <cmath> +#include <ctime> +#include <functional> #include <sstream> -#include "utils/file_system.h" -#include "utils/helpers.h" -#include "json/reader.h" #include "json/features.h" +#include "json/reader.h" #include "json/writer.h" -#include "utils/logger.h" #include "utils/date_time.h" +#include "utils/file_system.h" #include "utils/gen_hash.h" +#include "utils/helpers.h" +#include "utils/logger.h" #include "utils/macro.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" @@ -1906,8 +1906,9 @@ void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt, void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt, policy_table::PolicyTable& pt) { LOG4CXX_AUTO_TRACE(logger_); - pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>( - new_pt).app_policies_section.device; + pt.app_policies_section.device = + const_cast<policy_table::PolicyTable&>(new_pt) + .app_policies_section.device; pt.app_policies_section.apps[kDefaultId] = const_cast<policy_table::PolicyTable&>(new_pt) diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index bae9fceb49..5fa0b314b3 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -30,13 +30,13 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/policy_helper.h" +#include <string.h> #include <algorithm> #include <sstream> -#include <string.h> -#include "utils/logger.h" -#include "utils/custom_string.h" -#include "policy/policy_helper.h" #include "policy/policy_manager_impl.h" +#include "utils/custom_string.h" +#include "utils/logger.h" namespace policy { @@ -355,15 +355,15 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) { } } if (RESULT_NO_CHANGES == result) { - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " wasn't changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " wasn't changed."); return true; } - LOG4CXX_INFO(logger_, - "Permissions for application:" << app_id - << " have been changed."); + LOG4CXX_INFO( + logger_, + "Permissions for application:" << app_id << " have been changed."); if (IsPredefinedApp(app_policy)) { for (const policy_table::ApplicationPolicies::value_type& app : @@ -853,4 +853,4 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) { return true; } -} +} // namespace policy diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 10e1c73e9a..0884fc53b6 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -32,22 +32,22 @@ #include "policy/policy_manager_impl.h" #include <algorithm> -#include <set> -#include <queue> #include <iterator> #include <limits> +#include <queue> +#include <set> #include "json/reader.h" #include "json/writer.h" +#include "policy/policy_helper.h" #include "policy/policy_table.h" #include "policy/pt_representation.h" -#include "policy/policy_helper.h" +#include "utils/date_time.h" #include "utils/file_system.h" #include "utils/logger.h" -#include "utils/date_time.h" +#include "config_profile/profile.h" #include "policy/cache_manager.h" #include "policy/update_status_manager.h" -#include "config_profile/profile.h" #include "utils/timer_task_impl.h" #include "policy/access_remote.h" @@ -675,7 +675,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( if (device_id.empty()) { LOG4CXX_WARN(logger_, "Couldn't find device info for application id " - "'" << application_id << "'"); + "'" << application_id + << "'"); return; } @@ -1457,9 +1458,9 @@ void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) { if (GetDefaultHmi(who.app_id, &default_hmi)) { listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); } else { - LOG4CXX_WARN(logger_, - "Couldn't get default HMI level for application " - << who.app_id); + LOG4CXX_WARN( + logger_, + "Couldn't get default HMI level for application " << who.app_id); } } diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index 4db84e06ff..059c18d00e 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -7,7 +7,7 @@ bool IsTypeInvalid( rpc::Enum<rpc::policy_table_interface_base::RequestType> request) { return !request.is_valid(); } -} +} // namespace namespace rpc { namespace policy_table_interface_base { diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index c6f78d6d70..20ba9ec651 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -30,22 +30,22 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <sstream> -#include <stdlib.h> -#include <stdint.h> #include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include <unistd.h> +#include <sstream> -#include "utils/logger.h" +#include "config_profile/profile.h" +#include "policy/cache_manager.h" +#include "policy/policy_helper.h" +#include "policy/sql_pt_queries.h" +#include "policy/sql_pt_representation.h" +#include "policy/sql_wrapper.h" #include "utils/date_time.h" #include "utils/file_system.h" #include "utils/gen_hash.h" -#include "policy/sql_pt_representation.h" -#include "policy/sql_wrapper.h" -#include "policy/sql_pt_queries.h" -#include "policy/policy_helper.h" -#include "policy/cache_manager.h" -#include "config_profile/profile.h" +#include "utils/logger.h" namespace policy { @@ -81,9 +81,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id, utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectRpc)) { - LOG4CXX_WARN(logger_, - "Incorrect select statement from rpcs" - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect select statement from rpcs" << query.LastError().text()); return; } query.Bind(0, app_id); @@ -378,9 +378,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings* settings) { utils::dbms::SQLQuery check_first_run(db()); if (check_first_run.Prepare(sql_pt::kIsFirstRun) && check_first_run.Next()) { - LOG4CXX_INFO(logger_, - "Selecting is first run " - << check_first_run.GetBoolean(0)); + LOG4CXX_INFO( + logger_, + "Selecting is first run " << check_first_run.GetBoolean(0)); if (check_first_run.GetBoolean(0)) { utils::dbms::SQLQuery set_not_first_run(db()); set_not_first_run.Exec(sql_pt::kSetNotFirstRun); @@ -1125,9 +1125,9 @@ bool SQLPTRepresentation::SaveAppGroup( query.Bind(0, app_id); query.Bind(1, *it); if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group." - << query.LastError().text()); + LOG4CXX_WARN( + logger_, + "Incorrect insert into app group." << query.LastError().text()); return false; } } diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc index ed16fa3e8d..340f900cac 100644 --- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ #define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_ -#include <cassert> #include "policy/usage_statistics/counter.h" +#include <cassert> #include "utils/date_time.h" #include "utils/timer_task_impl.h" diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index f79bb683f8..d9dba45ef2 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "policy/access_remote_impl.h" +#include "gtest/gtest.h" namespace policy { diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc index d11bcec2ac..c09347fd9c 100644 --- a/src/components/policy/policy_regular/test/counter_test.cc +++ b/src/components/policy/policy_regular/test/counter_test.cc @@ -31,11 +31,11 @@ #include "gmock/gmock.h" -#include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/counter.h" +#include "policy/usage_statistics/mock_statistics_manager.h" -using ::testing::StrictMock; using ::testing::InSequence; +using ::testing::StrictMock; namespace test { namespace components { diff --git a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h index 78b7add643..aa6fb0828b 100644 --- a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h +++ b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h @@ -152,7 +152,7 @@ class DBMS { }; #endif // __QNX__ -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h index 72f183175c..44f7733985 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h @@ -37,9 +37,9 @@ #include "gmock/gmock.h" +#include "policy/policy_table/types.h" #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" namespace policy_table = ::rpc::policy_table_interface_base; diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index 97b1768666..39ff0efa7e 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -30,39 +30,38 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> +#include <ctime> #include <fstream> #include <string> -#include <ctime> +#include <vector> +#include "gtest/gtest.h" #include "json/reader.h" #include "json/writer.h" -#include "gtest/gtest.h" #include "config_profile/profile.h" +#include "policy/mock_cache_manager.h" +#include "policy/mock_policy_listener.h" +#include "policy/mock_policy_settings.h" +#include "policy/mock_update_status_manager.h" #include "policy/policy_manager_impl.h" #include "policy/policy_table/enums.h" #include "policy/policy_table/types.h" -#include "policy/mock_policy_settings.h" -#include "policy/mock_policy_listener.h" -#include "policy/mock_cache_manager.h" -#include "policy/mock_update_status_manager.h" -#include "utils/macro.h" -#include "utils/file_system.h" #include "utils/date_time.h" +#include "utils/file_system.h" +#include "utils/macro.h" -#include "utils/gen_hash.h" #include "policy/mock_access_remote.h" +#include "utils/gen_hash.h" -using ::testing::ReturnRef; -using ::testing::DoAll; -using ::testing::SetArgReferee; -using ::testing::NiceMock; using ::testing::_; -using ::testing::SetArgReferee; using ::testing::AtLeast; +using ::testing::DoAll; +using ::testing::NiceMock; using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SetArgReferee; using ::policy::PolicyManagerImpl; using ::policy::PolicyTable; @@ -932,9 +931,8 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) { date_time::MILLISECONDS_IN_SECOND; const uint32_t first_retry = timeout_after_x_seconds; EXPECT_EQ(first_retry, manager->NextRetryTimeout()); - uint32_t next_retry = - first_retry + - seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND; + uint32_t next_retry = first_retry + seconds_between_retries[0].asInt() * + date_time::MILLISECONDS_IN_SECOND; EXPECT_EQ(next_retry, manager->NextRetryTimeout()); next_retry = first_retry + next_retry + @@ -977,9 +975,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { Json::Value val2(Json::arrayValue); val2[0] = hmi_level[index]; val[new_data.new_field_value_]["hmi_levels"] = val2; - root["policy_table"]["functional_groupings"][new_data - .new_field_name_]["rpcs"] = - val; + root["policy_table"]["functional_groupings"][new_data.new_field_name_] + ["rpcs"] = val; root["policy_table"]["functional_groupings"][new_data.new_field_name_] ["user_consent_prompt"] = new_data.new_field_name_; } diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index 675d708843..dc11e11f12 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -29,39 +29,39 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <vector> -#include <string> +#include <stdio.h> +#include <sys/stat.h> #include <algorithm> #include <fstream> #include <memory> -#include <stdio.h> -#include <sys/stat.h> +#include <string> +#include <vector> #include "gtest/gtest.h" +#include "json/reader.h" +#include "json/writer.h" #include "policy/driver_dbms.h" -#include "policy/sql_pt_representation.h" -#include "policy/policy_types.h" #include "policy/mock_policy_settings.h" -#include "policy/policy_table/types.h" #include "policy/policy_table/enums.h" -#include "json/writer.h" -#include "json/reader.h" +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" +#include "policy/sql_pt_representation.h" #include "rpc_base/rpc_base.h" #include "utils/file_system.h" #include "utils/sqlite_wrapper/sql_database.h" namespace policy_table = rpc::policy_table_interface_base; -using policy::SQLPTRepresentation; using policy::CheckPermissionResult; -using policy::UserFriendlyMessage; using policy::EndpointUrls; +using policy::SQLPTRepresentation; +using policy::UserFriendlyMessage; using policy::VehicleInfo; -using testing::ReturnRef; -using testing::Return; -using testing::NiceMock; using testing::Mock; +using testing::NiceMock; +using testing::Return; +using testing::ReturnRef; namespace test { namespace components { diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 244858554f..459913fe72 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "policy/update_status_manager.h" #include "gtest/gtest.h" #include "policy/mock_policy_listener.h" #include "policy/policy_manager_impl.h" -#include "policy/update_status_manager.h" namespace test { namespace components { |