summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorigapchuck <igapchuck@luxoft.com>2019-05-17 10:34:57 +0300
committerigapchuck <igapchuck@luxoft.com>2019-06-06 15:07:30 +0300
commit06b0461502c5ec2fdf3f4ed889dbd2463ee7e368 (patch)
tree7869b5658d1613624a51f26654b1b1adb6c17f87
parent5ad1ec608c31d34c2248cd62e46384da6910f34b (diff)
downloadsdl_core-06b0461502c5ec2fdf3f4ed889dbd2463ee7e368.tar.gz
Update Unit tests because of incorrect behavior.
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc26
2 files changed, 29 insertions, 25 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
index 25083d5f64..d17112f611 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -207,7 +207,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillOnce(Return(true));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -235,7 +235,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -267,7 +267,7 @@ TEST_F(
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -319,7 +319,7 @@ TEST_F(
command = CreateRCCommand<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -364,7 +364,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -400,7 +400,7 @@ TEST_F(
MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _))
.WillOnce((Return(true)));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -426,7 +426,7 @@ TEST_F(
.WillOnce((Return(true)));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -467,7 +467,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_response_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -508,7 +508,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_message);
auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -553,7 +553,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
command = CreateRCCommand<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -595,7 +595,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
_))
.WillRepeatedly(Return(true));
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -610,7 +610,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
// Act
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -663,7 +663,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
event.set_smart_object(*hmi_response_message);
@@ -721,7 +721,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
event.set_smart_object(*hmi_response_message);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
index fc50288214..cdb4a4b48c 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -50,6 +50,7 @@ using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
using ::testing::_;
using ::testing::NiceMock;
using ::testing::Return;
@@ -143,8 +144,11 @@ TEST_F(SetInteriorVehicleDataRequestTest,
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::CLIMATE;
+ smart_objects::SmartObject climate_control_data(smart_objects::SmartType_Map);
+ climate_control_data[message_params::kFanSpeed] = 10;
+
msg_params[message_params::kModuleData][message_params::kClimateControlData] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
+ climate_control_data;
// Expectations
EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
.WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
@@ -154,15 +158,15 @@ TEST_F(SetInteriorVehicleDataRequestTest,
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::READ_ONLY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -193,16 +197,16 @@ TEST_F(
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::OUT_OF_MEMORY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -234,7 +238,7 @@ TEST_F(
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -269,7 +273,7 @@ TEST_F(SetInteriorVehicleDataRequestTest,
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
- command->Init();
+ ASSERT_TRUE(command->Init());
command->Run();
auto& msg_params_from_mobile =