diff options
author | JackLivio <jack@livio.io> | 2018-10-19 15:05:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 15:05:09 -0400 |
commit | d36316738785c96dab2ee892762ed08c059fffde (patch) | |
tree | 168a7c0705b5bc8f0dee7ce4b511ccf71759d9b4 /src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc | |
parent | 7f7fcbb998fb17f2954fd103349af67ea9b71a3f (diff) | |
parent | 83c5e805346d55ec7fb9f4ba8b6f6855d992273e (diff) | |
download | sdl_core-hotfix/templates_updates.tar.gz |
Merge pull request #2572 from smartdevicelink/release/5.0.05.0.0hotfix/templates_updatesfeature/show_app_menufeature/progress_bar_seekfeature/open-menu-rpcfeature/open-menu-rfeature/button
Release 5.0.0
Diffstat (limited to 'src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc')
-rw-r--r-- | src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index da0cd913b6..93d4e19751 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -113,27 +113,27 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) { EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg)); EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded()); - std::string priority = "emergency"; + std::string priority = "EMERGENCY"; uint32_t notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(1u, notif_number); - priority = "navigation"; + priority = "NAVIGATION"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(2u, notif_number); - priority = "emergency"; + priority = "EMERGENCY"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(1u, notif_number); - priority = "VOICECOMM"; + priority = "VOICECOM"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(3u, notif_number); - priority = "normal"; + priority = "NORMAL"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(5u, notif_number); - priority = "none"; + priority = "NONE"; notif_number = policy_manager_->GetNotificationsNumber(priority); EXPECT_EQ(6u, notif_number); } @@ -574,8 +574,7 @@ TEST_F(PolicyManagerImplTest2, GetUpdateUrl) { CreateLocalPT(preloaded_pt_filename_); GetPTU(kValidSdlPtUpdateJson); // Check expectations - const std::string update_url( - "http://policies.telematics.ford.com/api/policies"); + const std::string update_url("http://x.x.x.x:3000/api/1/policies"); EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7)); EXPECT_EQ("", policy_manager_->GetUpdateUrl(4)); } @@ -758,18 +757,18 @@ TEST_F(PolicyManagerImplTest2, policy_manager_->CheckPermissions( application_id_, kHmiLevelFull, "SendLocation", input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); ResetOutputList(output); // Rpc in LIMITED level policy_manager_->CheckPermissions( application_id_, kHmiLevelLimited, "SendLocation", input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); ResetOutputList(output); // Rpc in BACKGROUND level @@ -779,9 +778,9 @@ TEST_F(PolicyManagerImplTest2, input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); // Reset output ResetOutputList(output); @@ -846,17 +845,17 @@ TEST_F(PolicyManagerImplTest2, policy_manager_->CheckPermissions( application_id_, kHmiLevelFull, "SendLocation", input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); ResetOutputList(output); // Rpc in LIMITED level policy_manager_->CheckPermissions( application_id_, kHmiLevelLimited, "SendLocation", input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); ResetOutputList(output); // Rpc in BACKGROUND level @@ -865,9 +864,9 @@ TEST_F(PolicyManagerImplTest2, "SendLocation", input_params, output); - EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted); - EXPECT_TRUE(output.list_of_allowed_params.empty()); - EXPECT_EQ(10u, output.list_of_undefined_params.size()); + EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); + EXPECT_TRUE(output.list_of_undefined_params.empty()); + EXPECT_EQ(10u, output.list_of_allowed_params.size()); // Reset output ResetOutputList(output); @@ -925,9 +924,9 @@ TEST_F( } uint32_t GetCurrentDaysCount() { - TimevalStruct current_time = date_time::DateTime::getCurrentTime(); + date_time::TimeDuration current_time = date_time::getCurrentTime(); const uint32_t kSecondsInDay = 60 * 60 * 24; - return current_time.tv_sec / kSecondsInDay; + return date_time::getSecs(current_time) / kSecondsInDay; } TEST_F(PolicyManagerImplTest2, @@ -1093,7 +1092,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT(preloaded_pt_filename_); GetPTU(kValidSdlPtUpdateJson); - utils::SharedPtr<policy_table::Table> pt = + std::shared_ptr<policy_table::Table> pt = (policy_manager_->GetCache())->GetPT(); policy_table::ModuleConfig& module_config = pt->policy_table.module_config; ::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo(); @@ -1203,7 +1202,7 @@ TEST_F( HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) { // Arrange CreateLocalPT(preloaded_pt_filename_); - utils::SharedPtr<policy_table::Table> pt = + std::shared_ptr<policy_table::Table> pt = (policy_manager_->GetCache())->GetPT(); ::policy_table::PolicyTableType type1 = ::policy_table::PolicyTableType::PT_PRELOADED; @@ -1303,7 +1302,7 @@ TEST_F(PolicyManagerImplTest2, actual_groups_permissions[index].group_name); EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id); EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state); - utils::SharedPtr<policy_table::Table> pt = + std::shared_ptr<policy_table::Table> pt = (policy_manager_->GetCache())->GetPT(); uint32_t ucr_size = 0; ::policy_table::DeviceData& device_data = *pt->policy_table.device_data; |