summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2016-05-02 17:18:27 -0400
committerJackLivio <jack@livio.io>2016-05-02 17:18:27 -0400
commit17f5a0cafc02df8b896798da7f9a5f28616c0420 (patch)
tree2eabe3ccaf78bbe2fe44f5656d86d33ac0b7b3a3
parentdd1bb4b463894c2d78dedbd16b13dabbe41559e9 (diff)
downloadsdl_core-hotfix/policy_manager_impl_tests.tar.gz
Policy Manager Impl Tests Fixhotfix/policy_manager_impl_tests
Uncommented out policy tests so policy unit tests are included in the build. Also fixed one of the test cases to include the necessary parts for app_policies in the 'LoadPT_SetPT_PTIsLoaded' test. "make test" now passes.
-rw-r--r--src/components/policy/test/CMakeLists.txt2
-rw-r--r--src/components/policy/test/policy_manager_impl_test.cc17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/components/policy/test/CMakeLists.txt b/src/components/policy/test/CMakeLists.txt
index d23a50e7fe..5fc4de0ed6 100644
--- a/src/components/policy/test/CMakeLists.txt
+++ b/src/components/policy/test/CMakeLists.txt
@@ -53,7 +53,7 @@ set(testSources
usage_statistics_test.cc
shared_library_test.cc
generated_code_test.cc
- #policy_manager_impl_test.cc
+ policy_manager_impl_test.cc
)
include_directories(${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct)
diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc
index 84fbcf1116..944d2fd948 100644
--- a/src/components/policy/test/policy_manager_impl_test.cc
+++ b/src/components/policy/test/policy_manager_impl_test.cc
@@ -242,6 +242,7 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
app_policies["default"]["keep_context"] = Json::Value(true);
app_policies["default"]["steal_focus"] = Json::Value(true);
app_policies["default"]["certificate"] = Json::Value("sign");
+
app_policies["1234"] = Json::Value(Json::objectValue);
app_policies["1234"]["memory_kb"] = Json::Value(50);
app_policies["1234"]["heart_beat_timeout_ms"] = Json::Value(100);
@@ -253,6 +254,22 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
app_policies["1234"]["steal_focus"] = Json::Value(true);
app_policies["1234"]["certificate"] = Json::Value("sign");
+ app_policies["device"] = Json::Value(Json::objectValue);
+ app_policies["device"]["keep_context"] = Json::Value(false);
+ app_policies["device"]["steal_focus"] = Json::Value(false);
+ app_policies["device"]["priority"] = Json::Value("NONE");
+ app_policies["device"]["default_hmi"] = Json::Value("NONE");
+ app_policies["device"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["device"]["groups"][0] = Json::Value("DataConsent-2");
+
+ app_policies["pre_DataConsent"] = Json::Value(Json::objectValue);
+ app_policies["pre_DataConsent"]["keep_context"] = Json::Value(false);
+ app_policies["pre_DataConsent"]["steal_focus"] = Json::Value(false);
+ app_policies["pre_DataConsent"]["priority"] = Json::Value("NONE");
+ app_policies["pre_DataConsent"]["default_hmi"] = Json::Value("NONE");
+ app_policies["pre_DataConsent"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["pre_DataConsent"]["groups"][0] = Json::Value("BaseBeforeDataConsent");
+
policy_table::Table update(&table);
update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);