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

chrysler safety: fix mutations failures #2054

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

maxime-desroches
Copy link
Contributor

@maxime-desroches maxime-desroches commented Oct 2, 2024

Add coverage for these lines:

if ((chrysler_platform != CHRYSLER_PACIFICA) && (bus == 0) && (addr == chrysler_addrs->ESP_8)) {
vehicle_moving = ((GET_BYTE(to_push, 4) << 8) + GET_BYTE(to_push, 5)) != 0U;
}
if ((chrysler_platform == CHRYSLER_PACIFICA) && (bus == 0) && (addr == 514)) {
int speed_l = (GET_BYTE(to_push, 0) << 4) + (GET_BYTE(to_push, 1) >> 4);
int speed_r = (GET_BYTE(to_push, 2) << 4) + (GET_BYTE(to_push, 3) >> 4);
vehicle_moving = (speed_l != 0) || (speed_r != 0);

Changed the way the check is done in order to be fully testable

@maxime-desroches maxime-desroches changed the title chrysler: more coverage around setting vehicle_moving chrysler safety: more coverage around setting vehicle_moving Oct 2, 2024
@maxime-desroches maxime-desroches changed the title chrysler safety: more coverage around setting vehicle_moving chrysler safety: fix mutations failures Oct 3, 2024
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.

2 participants