diff options
author | Ivo Stoilov (GitHub) <istoilov@luxoft.com> | 2017-01-19 12:03:06 +0200 |
---|---|---|
committer | Ivo Stoilov (GitHub) <istoilov@luxoft.com> | 2017-01-25 16:50:56 +0200 |
commit | 046ffb3b0d0926fee7368e995fe1b688032a801c (patch) | |
tree | b38594a3405144bebfedcb4b87a5b252ae4f6dd8 /src | |
parent | 29333dac98a80a27633fc59bea9e240e7a149a65 (diff) | |
download | sdl_core-046ffb3b0d0926fee7368e995fe1b688032a801c.tar.gz |
Update test namespaces in policy_tests
Related tasks APPLINK-30588 APPLINK-30974
Diffstat (limited to 'src')
12 files changed, 62 insertions, 36 deletions
diff --git a/src/components/policy/test/generated_code_test.cc b/src/components/policy/test/generated_code_test.cc index 8b1a4d7478..671103bf51 100644 --- a/src/components/policy/test/generated_code_test.cc +++ b/src/components/policy/test/generated_code_test.cc @@ -43,7 +43,7 @@ using rpc::policy_table_interface_base::Table; namespace test { namespace components { -namespace policy { +namespace policy_test { TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) { std::ifstream json_file("sdl_preloaded_pt.json"); @@ -67,6 +67,6 @@ TEST(PolicyGeneratedCodeTest, TestValidPTUpdateJsonIsValid) { ASSERT_RPCTYPE_VALID(table); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/test/include/driver_dbms.h b/src/components/policy/test/include/driver_dbms.h index edd183dbd4..b92895a5f1 100644 --- a/src/components/policy/test/include/driver_dbms.h +++ b/src/components/policy/test/include/driver_dbms.h @@ -40,7 +40,7 @@ namespace test { namespace components { -namespace policy { +namespace policy_test { #ifdef __QNX__ class DBMS { @@ -152,7 +152,7 @@ class DBMS { }; #endif // __QNX__ -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/test/include/mock_cache_manager.h b/src/components/policy/test/include/mock_cache_manager.h index cee22bdda7..907e3f7711 100644 --- a/src/components/policy/test/include/mock_cache_manager.h +++ b/src/components/policy/test/include/mock_cache_manager.h @@ -38,10 +38,16 @@ #include "gmock/gmock.h" #include "policy/cache_manager_interface.h" +#include "policy/policy_table/types.h" -namespace policy_table = rpc::policy_table_interface_base; +namespace test { +namespace components { +namespace policy_test { -namespace policy { +namespace { + using namespace policy; + namespace policy_table = rpc::policy_table_interface_base; +} class MockCacheManagerInterface : public CacheManagerInterface { public: @@ -202,6 +208,8 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); }; -} // namespace policy +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ diff --git a/src/components/policy/test/include/mock_policy_listener.h b/src/components/policy/test/include/mock_policy_listener.h index b2f9bc70df..b160c43fac 100644 --- a/src/components/policy/test/include/mock_policy_listener.h +++ b/src/components/policy/test/include/mock_policy_listener.h @@ -43,7 +43,13 @@ namespace policy_table = ::rpc::policy_table_interface_base; -namespace policy { +namespace test { +namespace components { +namespace policy_test { + +namespace { + using namespace policy; +} namespace custom_str = utils::custom_string; @@ -76,6 +82,8 @@ class MockPolicyListener : public PolicyListener { void(const AppPermissions&, const std::string&)); }; -} // namespace policy +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ diff --git a/src/components/policy/test/include/mock_policy_manager.h b/src/components/policy/test/include/mock_policy_manager.h index 15d1e5d469..b49f297fc4 100644 --- a/src/components/policy/test/include/mock_policy_manager.h +++ b/src/components/policy/test/include/mock_policy_manager.h @@ -46,7 +46,9 @@ namespace policy_table = ::rpc::policy_table_interface_base; -namespace policy_manager { +namespace test { +namespace components { +namespace policy_test { using namespace policy; @@ -174,6 +176,8 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings)); }; -} // namespace policy_manager +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_POLICY_MANAGER_H_ diff --git a/src/components/policy/test/include/mock_pt_ext_representation.h b/src/components/policy/test/include/mock_pt_ext_representation.h index 88c96e8a8c..fd7a3585f1 100644 --- a/src/components/policy/test/include/mock_pt_ext_representation.h +++ b/src/components/policy/test/include/mock_pt_ext_representation.h @@ -44,9 +44,12 @@ namespace policy_table = ::rpc::policy_table_interface_base; -namespace policy { +namespace test { +namespace components { +namespace policy_test { + class MockPTExtRepresentation : public MockPTRepresentation, - public PTExtRepresentation { + public policy::PTExtRepresentation { public: MOCK_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); @@ -112,7 +115,7 @@ class MockPTExtRepresentation : public MockPTRepresentation, void(const std::string& app_id, const std::string& type, const std::string& value)); - MOCK_CONST_METHOD3(Add, + MOCK_CONST_METHOD3(} // namespace policy_managerAdd, void(const std::string& app_id, const std::string& type, int seconds)); @@ -134,6 +137,8 @@ class MockPTExtRepresentation : public MockPTRepresentation, const std::string& functional_group)); }; -} // namespace policy +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_PT_EXT_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 b875abfabb..6f323963c0 100644 --- a/src/components/policy/test/include/mock_pt_representation.h +++ b/src/components/policy/test/include/mock_pt_representation.h @@ -43,9 +43,11 @@ namespace policy_table = ::rpc::policy_table_interface_base; -namespace policy { +namespace test { +namespace components { +namespace policy_test { -class MockPTRepresentation : virtual public PTRepresentation { +class MockPTRepresentation : public policy::PTRepresentation { public: MOCK_METHOD4(CheckPermissions, void(const PTString& app_id, @@ -100,6 +102,8 @@ class MockPTRepresentation : virtual public PTRepresentation { MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id)); }; -} // namespace policy +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_PT_REPRESENTATION_H_ diff --git a/src/components/policy/test/include/mock_update_status_manager.h b/src/components/policy/test/include/mock_update_status_manager.h index 04700246af..6b7c705b1c 100644 --- a/src/components/policy/test/include/mock_update_status_manager.h +++ b/src/components/policy/test/include/mock_update_status_manager.h @@ -36,9 +36,11 @@ #include "policy/update_status_manager.h" -namespace policy { +namespace test { +namespace components { +namespace policy_test { -class MockUpdateStatusManager : public UpdateStatusManager { +class MockUpdateStatusManager : public policy::UpdateStatusManager { public: MOCK_METHOD1(set_listener, void(PolicyListener* listener)); MOCK_METHOD1(OnUpdateSentOut, void(uint32_t update_timeout)); @@ -52,6 +54,8 @@ class MockUpdateStatusManager : public UpdateStatusManager { MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus()); }; -} // namespace policy +} // namespace policy_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_ diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc index 34bcc1127e..d1833cfdad 100644 --- a/src/components/policy/test/policy_manager_impl_test.cc +++ b/src/components/policy/test/policy_manager_impl_test.cc @@ -63,11 +63,6 @@ using ::testing::SetArgReferee; using ::testing::AtLeast; using ::testing::Return; -using ::policy::MockPolicyListener; - -using ::policy::MockCacheManagerInterface; -using ::policy::MockUpdateStatusManager; - using ::policy::PolicyManagerImpl; using ::policy::PolicyTable; @@ -75,7 +70,7 @@ namespace policy_table = rpc::policy_table_interface_base; namespace test { namespace components { -namespace policy { +namespace policy_test { namespace custom_str = utils::custom_string; @@ -1335,6 +1330,6 @@ TEST_F( EXPECT_EQ(heart_beat_timeout.asUInt(), result); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/test/shared_library_test.cc b/src/components/policy/test/shared_library_test.cc index f4177f0fd9..b7183a9085 100644 --- a/src/components/policy/test/shared_library_test.cc +++ b/src/components/policy/test/shared_library_test.cc @@ -35,7 +35,7 @@ namespace test { namespace components { -namespace policy { +namespace policy_test { ::testing::AssertionResult IsError(void* error) { if (error) { @@ -71,6 +71,6 @@ TEST(SharedLibraryTest, EXPECT_FALSE(IsError(dlerror())); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/test/sql_pt_representation_test.cc b/src/components/policy/test/sql_pt_representation_test.cc index 42f7a9cc33..b5ff9b5ec9 100644 --- a/src/components/policy/test/sql_pt_representation_test.cc +++ b/src/components/policy/test/sql_pt_representation_test.cc @@ -68,7 +68,7 @@ using testing::Mock; namespace test { namespace components { -namespace policy { +namespace policy_test { class SQLPTRepresentationTest : public SQLPTRepresentation, public ::testing::Test { @@ -1706,6 +1706,6 @@ TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) { EXPECT_EQ(3u, devices.size()); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test diff --git a/src/components/policy/test/update_status_manager_test.cc b/src/components/policy/test/update_status_manager_test.cc index 623cb974d8..eb27b360d1 100644 --- a/src/components/policy/test/update_status_manager_test.cc +++ b/src/components/policy/test/update_status_manager_test.cc @@ -35,11 +35,9 @@ #include "policy/policy_manager_impl.h" #include "policy/update_status_manager.h" -using ::policy::MockPolicyListener; - namespace test { namespace components { -namespace policy { +namespace policy_test { using namespace ::policy; @@ -87,6 +85,6 @@ TEST_F(UpdateStatusManagerTest, EXPECT_FALSE(manager_->IsAppsSearchInProgress()); } -} // namespace policy +} // namespace policy_test } // namespace components } // namespace test |