diff options
author | Conlain Kelly <conlain.k@gmail.com> | 2018-08-10 11:04:43 -0400 |
---|---|---|
committer | Conlain Kelly <conlain.k@gmail.com> | 2018-08-10 11:04:43 -0400 |
commit | 72a64f7419d20bc379d1e050fdaac90b2a6d097f (patch) | |
tree | f5be0f57b4699b2fd30a459c105cfb44c6903508 /src/components/policy/policy_regular/test/policy_manager_impl_test.cc | |
parent | 3b5ddfdacb94f4e3f5752bb7165ca668f62f4a5d (diff) | |
parent | 43e53192045daeff8e9e2887c8b67894725240b5 (diff) | |
download | sdl_core-72a64f7419d20bc379d1e050fdaac90b2a6d097f.tar.gz |
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_core into feature/boost_datetime_implementation
Diffstat (limited to 'src/components/policy/policy_regular/test/policy_manager_impl_test.cc')
-rw-r--r-- | src/components/policy/policy_regular/test/policy_manager_impl_test.cc | 26 |
1 files changed, 10 insertions, 16 deletions
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 08a939ecda..867cf5b2ef 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 @@ -51,11 +51,10 @@ #include "utils/macro.h" #include "utils/file_system.h" #include "utils/date_time.h" -#include "utils/make_shared.h" + #include "utils/gen_hash.h" -#ifdef SDL_REMOTE_CONTROL #include "policy/mock_access_remote.h" -#endif // SDL_REMOTE_CONTROL + using ::testing::ReturnRef; using ::testing::DoAll; using ::testing::SetArgReferee; @@ -146,20 +145,15 @@ class PolicyManagerImplTest : public ::testing::Test { MockCacheManagerInterface* cache_manager; NiceMock<MockPolicyListener> listener; const std::string device_id; -#ifdef SDL_REMOTE_CONTROL - utils::SharedPtr<access_remote_test::MockAccessRemote> access_remote; -#endif // SDL_REMOTE_CONTROL + std::shared_ptr<access_remote_test::MockAccessRemote> access_remote; void SetUp() OVERRIDE { manager = new PolicyManagerImpl(); manager->set_listener(&listener); cache_manager = new MockCacheManagerInterface(); manager->set_cache_manager(cache_manager); - -#ifdef SDL_REMOTE_CONTROL - access_remote = new access_remote_test::MockAccessRemote(); + access_remote = std::shared_ptr<access_remote_test::MockAccessRemote>(); manager->set_access_remote(access_remote); -#endif // SDL_REMOTE_CONTROL } void TearDown() OVERRIDE { @@ -358,7 +352,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { // Get cache ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache(); // Get table_snapshot - utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot(); + std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot(); // Set functional groupings from policy table input_functional_groupings = table->policy_table.functional_groupings; } @@ -726,8 +720,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) { const std::string json = table.toStyledString(); ::policy::BinaryMessage msg(json.begin(), json.end()); - utils::SharedPtr<policy_table::Table> snapshot = - utils::MakeShared<policy_table::Table>(update.policy_table); + std::shared_ptr<policy_table::Table> snapshot = + std::make_shared<policy_table::Table>(update.policy_table); // Assert EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot)); EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true)); @@ -967,7 +961,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { // Arrange ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache(); - utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot(); + std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot(); // Get FunctionalGroupings policy_table::FunctionalGroupings& fc = table->policy_table.functional_groupings; @@ -1259,7 +1253,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT("sdl_preloaded_pt.json"); GetPTU("valid_sdl_pt_update.json"); - utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt(); + std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt(); policy_table::ModuleConfig& module_config = pt->policy_table.module_config; ::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo(); @@ -1340,7 +1334,7 @@ TEST_F( HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) { // Arrange CreateLocalPT("sdl_preloaded_pt.json"); - utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt(); + std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt(); ::policy_table::PolicyTableType type1 = ::policy_table::PolicyTableType::PT_PRELOADED; pt->SetPolicyTableType(type1); |