From 18f148a29447bfbffced4bdbc88abb22013992a2 Mon Sep 17 00:00:00 2001 From: Aleksandr Galiuzov Date: Tue, 22 Jul 2014 10:57:27 +0300 Subject: APPLINK-8115 made tests workable --- .../policy/test/policy/include/generated_code_with_sqlite_test.h | 3 +-- src/components/policy/test/policy/include/mock_pt_ext_representation.h | 2 -- src/components/policy/test/policy/include/mock_pt_representation.h | 2 ++ .../policy/test/policy/src/generated_code_with_sqlite_test.cc | 3 +-- src/components/policy/test/policy/src/test_sql_pt_representation.cc | 1 + 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/policy/test/policy/include/generated_code_with_sqlite_test.h b/src/components/policy/test/policy/include/generated_code_with_sqlite_test.h index ff9355cc04..614678f28d 100644 --- a/src/components/policy/test/policy/include/generated_code_with_sqlite_test.h +++ b/src/components/policy/test/policy/include/generated_code_with_sqlite_test.h @@ -342,8 +342,7 @@ bool UpdateSection(dbms::SQLDatabase* db, policy_table::ApplicationParams app_params = (*it_ap).second; // Priority binding - // This param is present in extended policy table interface only - //app_policies_sqlquery.Bind(2, app_params.priority); + app_policies_sqlquery.Bind(2, app_params.priority); app_policies_sqlquery.Bind(2, "Dummy priority parameter"); // Add record to AppPolicies table diff --git a/src/components/policy/test/policy/include/mock_pt_ext_representation.h b/src/components/policy/test/policy/include/mock_pt_ext_representation.h index 12b69dc0ce..cbfac63b32 100644 --- a/src/components/policy/test/policy/include/mock_pt_ext_representation.h +++ b/src/components/policy/test/policy/include/mock_pt_ext_representation.h @@ -51,8 +51,6 @@ class MockPTExtRepresentation : public MockPTRepresentation, bool(const std::string& app_id)); MOCK_METHOD2(GetDefaultHMI, bool(const std::string& app_id, std::string* default_hmi)); - MOCK_METHOD2(GetPriority, - bool(const std::string& app_id, std::string* priority)); MOCK_METHOD0(ResetUserConsent, bool()); MOCK_METHOD0(ResetDeviceConsents, bool()); diff --git a/src/components/policy/test/policy/include/mock_pt_representation.h b/src/components/policy/test/policy/include/mock_pt_representation.h index 46660e6b34..ebc97f3453 100644 --- a/src/components/policy/test/policy/include/mock_pt_representation.h +++ b/src/components/policy/test/policy/include/mock_pt_representation.h @@ -65,6 +65,8 @@ class MockPTRepresentation : virtual public PTRepresentation { int()); MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector* seconds)); + MOCK_METHOD2(GetPriority, + bool(const std::string& app_id, std::string* priority)); MOCK_METHOD0(GetVehicleData, VehicleData()); MOCK_METHOD2(GetUserFriendlyMsg, diff --git a/src/components/policy/test/policy/src/generated_code_with_sqlite_test.cc b/src/components/policy/test/policy/src/generated_code_with_sqlite_test.cc index 885f79b8b7..86c934ff81 100644 --- a/src/components/policy/test/policy/src/generated_code_with_sqlite_test.cc +++ b/src/components/policy/test/policy/src/generated_code_with_sqlite_test.cc @@ -144,8 +144,7 @@ TEST_F(GeneratedCodeTest, UpdateSectionAppPolicies) { policy_table::ApplicationPolicies ap; const std::string application_id = "12345678"; ap[application_id].groups.push_back("Base-4"); - // This param is present in extended policy table interface only - //ap[application_id].priority = policy_table::P_NORMAL; + ap[application_id].priority = policy_table::P_NORMAL; EXPECT_TRUE(policy_table::UpdateSection(&db, ap)); diff --git a/src/components/policy/test/policy/src/test_sql_pt_representation.cc b/src/components/policy/test/policy/src/test_sql_pt_representation.cc index a2e9c579e0..1f2d021a94 100644 --- a/src/components/policy/test/policy/src/test_sql_pt_representation.cc +++ b/src/components/policy/test/policy/src/test_sql_pt_representation.cc @@ -422,6 +422,7 @@ TEST_F(SQLPTRepresentationTest, SaveGenerateSnapshot) { Json::Value& app_policies = policy_table["app_policies"]; app_policies["default"] = Json::Value(Json::objectValue); + app_policies["default"]["priority"] = Json::Value("EMERGENCY"); app_policies["default"]["memory_kb"] = Json::Value(50); app_policies["default"]["watchdog_timer_ms"] = Json::Value(100); app_policies["default"]["groups"] = Json::Value(Json::arrayValue); -- cgit v1.2.1