diff options
author | JackLivio <jack@livio.io> | 2019-03-17 13:49:14 -0400 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2019-03-17 13:49:14 -0400 |
commit | c7cfce0fe516b1b5edb231fe65b1e6d57580abd6 (patch) | |
tree | c10db3e0db9991d07e35d69e46765aab08239bd4 /src/components/policy/policy_regular | |
parent | baf16b9012ed2478d7b84cd64adbd6779224899d (diff) | |
download | sdl_core-c7cfce0fe516b1b5edb231fe65b1e6d57580abd6.tar.gz |
Address comments
Diffstat (limited to 'src/components/policy/policy_regular')
-rw-r--r-- | src/components/policy/policy_regular/test/policy_manager_impl_test.cc | 12 | ||||
-rw-r--r-- | src/components/policy/policy_regular/test/sql_pt_representation_test.cc | 8 |
2 files changed, 12 insertions, 8 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 5f3e81232e..da5a677602 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 @@ -835,6 +835,7 @@ TEST_F( } TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) { + std::string media_str = "MEDIA"; // Arrange CreateLocalPT("sdl_preloaded_pt.json"); EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus()); @@ -845,18 +846,19 @@ TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) { policy_table::AppServiceParameters(); manager->GetAppServiceParameters(app_id2, &app_service_parameters); - ASSERT_FALSE(app_service_parameters.find("MEDIA") == + ASSERT_FALSE(app_service_parameters.find(media_str) == app_service_parameters.end()); - auto service_names = *(app_service_parameters["MEDIA"].service_names); + auto service_names = *(app_service_parameters[media_str].service_names); - EXPECT_TRUE(service_names.is_initialized()); + ASSERT_TRUE(service_names.is_initialized()); + ASSERT_EQ(service_names.size(), 2u); EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App"); EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music"); - auto handled_rpcs = app_service_parameters["MEDIA"].handled_rpcs; + auto handled_rpcs = app_service_parameters[media_str].handled_rpcs; - EXPECT_TRUE(handled_rpcs.is_initialized()); + ASSERT_TRUE(handled_rpcs.is_initialized()); EXPECT_EQ(handled_rpcs[0].function_id, 41); // Check no update required diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index 9063c280bd..0055ce2ee9 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -1730,16 +1730,18 @@ TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) { EXPECT_EQ(3u, devices.size()); const std::string kAppId = "1234"; + const std::string media_str = "MEDIA"; policy_table::AppServiceParameters app_service_parameters; GatherAppServiceParameters(kAppId, &app_service_parameters); - ASSERT_FALSE(app_service_parameters.find("MEDIA") == + ASSERT_FALSE(app_service_parameters.find(media_str) == app_service_parameters.end()); - auto service_names = *(app_service_parameters["MEDIA"].service_names); + auto service_names = *(app_service_parameters[media_str].service_names); EXPECT_TRUE(service_names.is_initialized()); + ASSERT_EQ(service_names.size(), 2u); EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App"); EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music"); - auto handled_rpcs = app_service_parameters["MEDIA"].handled_rpcs; + auto handled_rpcs = app_service_parameters[media_str].handled_rpcs; EXPECT_TRUE(handled_rpcs.is_initialized()); EXPECT_EQ(handled_rpcs[0].function_id, 41); |