-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finalize SET_MTA command response properly
- Loading branch information
lmbsog0
committed
Dec 13, 2022
1 parent
46bbca4
commit 1879789
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from .parameter import * | ||
from .conftest import XcpTest | ||
|
||
|
||
@pytest.mark.parametrize('trailing_value', trailing_values) | ||
@pytest.mark.parametrize('max_cto', max_ctos) | ||
def test_set_mta_sets_all_remaining_bytes_to_trailing_value(trailing_value, max_cto): | ||
handle = XcpTest(DefaultConfig(channel_rx_pdu_ref=0x0001, max_cto=max_cto, trailing_value=trailing_value)) | ||
handle.lib.Xcp_CanIfRxIndication(0x0001, handle.get_pdu_info((0xFF, 0x00))) | ||
handle.lib.Xcp_MainFunction() | ||
handle.lib.Xcp_CanIfTxConfirmation(0x0001, handle.define('E_OK')) | ||
handle.lib.Xcp_CanIfRxIndication(0x0001, handle.get_pdu_info((0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))) | ||
handle.lib.Xcp_MainFunction() | ||
remaining_zeros = tuple(trailing_value for _ in range(max_cto - 0x08)) | ||
assert tuple(handle.can_if_transmit.call_args[0][1].SduDataPtr[0x08:max_cto]) == remaining_zeros |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters