From 7762404a0d8dc67c6b1943bac4aeaea2d75a46f5 Mon Sep 17 00:00:00 2001 From: iAndrew5 Date: Fri, 16 Oct 2015 18:09:35 +0300 Subject: Added UT for SQL PT Representation Added some new code to policy, rpc_base, utils and application_manager components --- src/components/policy/test/include/mock_pt_representation.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/policy/test/include/mock_pt_representation.h') diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h index 720c646aba..3d2be69ca2 100644 --- a/src/components/policy/test/include/mock_pt_representation.h +++ b/src/components/policy/test/include/mock_pt_representation.h @@ -39,7 +39,7 @@ #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "./types.h" +#include "table_struct_ext/types.h" namespace policy_table = ::rpc::policy_table_interface_base; @@ -72,8 +72,8 @@ class MockPTRepresentation : virtual public PTRepresentation { bool(std::vector* seconds)); MOCK_METHOD2(GetPriority, bool(const std::string& app_id, std::string* priority)); - MOCK_METHOD0(GetVehicleData, - VehicleData()); + MOCK_CONST_METHOD0(GetVehicleInfo, + const VehicleInfo()); MOCK_METHOD1(SetVINValue, bool(const std::string& value)); MOCK_METHOD2(GetUserFriendlyMsg, -- cgit v1.2.1 From d9a71e1095e932faaffea9eecfde1ab0ecfbc9f0 Mon Sep 17 00:00:00 2001 From: Veronica Veremjova Date: Thu, 15 Oct 2015 17:49:13 +0300 Subject: Unit tests for policy --- src/components/policy/test/include/mock_pt_representation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/policy/test/include/mock_pt_representation.h') diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h index 3d2be69ca2..ad70155af7 100644 --- a/src/components/policy/test/include/mock_pt_representation.h +++ b/src/components/policy/test/include/mock_pt_representation.h @@ -39,7 +39,7 @@ #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "table_struct_ext/types.h" +#include "table_struct/types.h" namespace policy_table = ::rpc::policy_table_interface_base; -- cgit v1.2.1 From 4ecdb2a83871784f34430ed09d5ef6a2c0855506 Mon Sep 17 00:00:00 2001 From: Kozoriz Date: Tue, 26 Apr 2016 12:41:54 +0300 Subject: Format all code in project Formated all code in appMain, components, plugins to correct coding-style Used clang-format-3.6 Used 2 commands : find src/appMain/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file find src/components/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file find src/plugins/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file --- .../policy/test/include/mock_pt_representation.h | 91 +++++++++------------- 1 file changed, 37 insertions(+), 54 deletions(-) (limited to 'src/components/policy/test/include/mock_pt_representation.h') diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h index ad70155af7..7906018721 100644 --- a/src/components/policy/test/include/mock_pt_representation.h +++ b/src/components/policy/test/include/mock_pt_representation.h @@ -48,69 +48,52 @@ namespace policy { class MockPTRepresentation : virtual public PTRepresentation { public: MOCK_METHOD4(CheckPermissions, - void(const PTString& app_id, - const PTString& hmi_level, - const PTString& rpc, - CheckPermissionResult& result)); - MOCK_METHOD0(IsPTPreloaded, - bool()); - MOCK_METHOD0(IgnitionCyclesBeforeExchange, - int()); - MOCK_METHOD1(KilometersBeforeExchange, - int(int current)); + void(const PTString& app_id, + const PTString& hmi_level, + const PTString& rpc, + CheckPermissionResult& result)); + MOCK_METHOD0(IsPTPreloaded, bool()); + MOCK_METHOD0(IgnitionCyclesBeforeExchange, int()); + MOCK_METHOD1(KilometersBeforeExchange, int(int current)); MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate, - bool(int kilometers, int days_after_epoch)); - MOCK_METHOD1(DaysBeforeExchange, - int(int current)); - MOCK_METHOD0(IncrementIgnitionCycles, - void()); - MOCK_METHOD0(ResetIgnitionCycles, - void()); - MOCK_METHOD0(TimeoutResponse, - int()); - MOCK_METHOD1(SecondsBetweenRetries, - bool(std::vector* seconds)); + bool(int kilometers, int days_after_epoch)); + MOCK_METHOD1(DaysBeforeExchange, int(int current)); + MOCK_METHOD0(IncrementIgnitionCycles, void()); + MOCK_METHOD0(ResetIgnitionCycles, void()); + MOCK_METHOD0(TimeoutResponse, int()); + MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector* seconds)); MOCK_METHOD2(GetPriority, - bool(const std::string& app_id, std::string* priority)); - MOCK_CONST_METHOD0(GetVehicleInfo, - const VehicleInfo()); - MOCK_METHOD1(SetVINValue, - bool(const std::string& value)); - MOCK_METHOD2(GetUserFriendlyMsg, + bool(const std::string& app_id, std::string* priority)); + MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); + MOCK_METHOD1(SetVINValue, bool(const std::string& value)); + MOCK_METHOD2( + GetUserFriendlyMsg, std::vector(const std::vector& msg_code, - const std::string& language)); - MOCK_METHOD2(GetUpdateUrls, - void(int service_type, EndpointUrls&)); - MOCK_METHOD1(GetNotificationsNumber, - int(const std::string& priority)); - MOCK_METHOD0(Init, - InitResult()); - MOCK_METHOD0(Close, - bool()); - MOCK_METHOD0(Clear, - bool()); - MOCK_METHOD0(Drop, - bool()); - MOCK_CONST_METHOD0(GenerateSnapshot, - utils::SharedPtr()); - MOCK_METHOD1(Save, - bool(const policy_table::Table& table)); - MOCK_CONST_METHOD0(UpdateRequired, - bool()); - MOCK_METHOD1(SaveUpdateRequired, - void(bool value)); + const std::string& language)); + MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls&)); + MOCK_METHOD1(GetNotificationsNumber, int(const std::string& priority)); + MOCK_METHOD0(Init, InitResult()); + MOCK_METHOD0(Close, bool()); + MOCK_METHOD0(Clear, bool()); + MOCK_METHOD0(Drop, bool()); + MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD1(Save, bool(const policy_table::Table& table)); + MOCK_CONST_METHOD0(UpdateRequired, bool()); + MOCK_METHOD1(SaveUpdateRequired, void(bool value)); MOCK_METHOD3(GetInitialAppData, - bool(const std::string& app_id, StringArray* nicknames, StringArray* app_types)); + bool(const std::string& app_id, + StringArray* nicknames, + StringArray* app_types)); MOCK_METHOD4(SaveApplicationCustomData, - bool(const std::string& app_id, - bool is_revoked, - bool is_default, - bool is_predata)); + bool(const std::string& app_id, + bool is_revoked, + bool is_default, + bool is_predata)); MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id)); MOCK_METHOD1(GetFunctionalGroupings, - bool(policy_table::FunctionalGroupings& groups)); + bool(policy_table::FunctionalGroupings& groups)); MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id)); MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id)); MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id)); -- cgit v1.2.1 From 9dba2aecd2a4c7b4054067deb413311c44c80cac Mon Sep 17 00:00:00 2001 From: Kozoriz Date: Wed, 11 May 2016 10:05:02 +0300 Subject: Correct project structure in Policy component FIles moved to correct directory CMakeLists files corrected Headers corrected --- src/components/policy/test/include/mock_pt_representation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/policy/test/include/mock_pt_representation.h') diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h index 7906018721..045c901be2 100644 --- a/src/components/policy/test/include/mock_pt_representation.h +++ b/src/components/policy/test/include/mock_pt_representation.h @@ -39,7 +39,7 @@ #include "policy/pt_representation.h" #include "rpc_base/rpc_base.h" -#include "table_struct/types.h" +#include "policy/policy_table/types.h" namespace policy_table = ::rpc::policy_table_interface_base; -- cgit v1.2.1