Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdl passenger mode unit tests #14

Merged

Conversation

LuxoftAKutsan
Copy link

@LuxoftAKutsan LuxoftAKutsan commented Jan 10, 2019

Unit tests fix after implementation smartdevicelink#2134

Additional unit test for SDL passenger mode lockScreenDismissalEnabled added

Fixed bug : crash on empty optional copy

This PR is ready for review.

@@ -1794,24 +1794,36 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
CreateCommand<hmi::OnDriverDistractionNotification>(message);

EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
ON_CALL(app_mngr_, GetPolicyHandler())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan I would suggest you to extract these lines to a separate helper function as they are duplicated in at least 3 places

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AKalinich-Luxoft hmi_notifications_test.cc contains a lot of other tests, not related to the task. Most of them have different basic expectations. Helper function would be to specific to all this variety.

ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_interface_));
ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
.WillByDefault(Return(utils::OptionalVal<bool>(true)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan Why did not you use typedef in this translation unit like you did in other one?

@LuxoftAKutsan LuxoftAKutsan requested review from LitvinenkoIra and removed request for LitvinenkoIra January 11, 2019 14:29
@LuxoftAKutsan LuxoftAKutsan merged commit dc7752c into feature/sdl_passenger_mode Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants