summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
diff options
context:
space:
mode:
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.cc26
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 5fd0a48f7c..86df87d534 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);