-
Notifications
You must be signed in to change notification settings - Fork 20
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
feature(cdc_teardown): Added iteration test #106
base: master
Are you sure you want to change the base?
Conversation
a1e0772
to
d302232
Compare
5922503
to
be83b3f
Compare
for (int i = 0; i < TEARDOWN_CMD_RPL_SIZE; i++) { | ||
TEST_ASSERT_EQUAL(TEARDOWN_CMD_KEY, rx_buf[i]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i = 0; i < TEARDOWN_CMD_RPL_SIZE; i++) { | |
TEST_ASSERT_EQUAL(TEARDOWN_CMD_KEY, rx_buf[i]); | |
} | |
TEST_ASSERT_EACH_EQUAL_UINT8(TEARDOWN_CMD_KEY, rx_buf, TEARDOWN_CMD_RPL_SIZE); |
You can use EACH_EQUAL
macro to compare an array to a single value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the idea!
} | ||
// Remove primitives | ||
vSemaphoreDelete(wait_mount); | ||
vSemaphoreDelete(wait_command); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vSemaphoreDelete(wait_command); | |
vSemaphoreDelete(wait_command); | |
vSemaphoreDelete(wait_terminal); |
Delete also the wait_terminal
semaphore.
@pytest.mark.esp32s3 | ||
@pytest.mark.esp32p4 | ||
@pytest.mark.usb_device | ||
def test_usb_teardown_device(dut) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_usb_teardown_device(dut) -> None: | |
def test_usb_teardown_device(dut: IdfDut) -> None: |
I don't know if you are using some linting extension in VSCode, (I am using Pylint), It will give you some information and corrections about coding style.
This suggestion also comes from Pylint.
|
||
def teardown_device(key_len, amount): | ||
TUSB_VID = 0x303A # Espressif TinyUSB VID | ||
TUSB_PID = 0x4002 # Espressif TinyUSB VID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TUSB_PID = 0x4002 # Espressif TinyUSB VID | |
TUSB_PID = 0x4002 # Espressif TinyUSB PID |
TUSB_VID = 0x303A # Espressif TinyUSB VID | ||
TUSB_PID = 0x4002 # Espressif TinyUSB VID | ||
|
||
# Command to send and expected response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Command to send and expected response | |
# Command to send an expected response |
Or Command to send and expect response
@peter-marcisovsky Thanks for the review, I will apply all the notes. |
be83b3f
to
a444bcb
Compare
Description
Related
Testing
Added test_app
teardown_device
for CDC Device Class. The logic of the test:command sequence[] = ep_size * 0xAA
response sequence[] = ep_size * 0x55
Hint: Values
0xAA
and0x55
were selected to verify the buffer memory integrity, as the0xAA
and0x55
are the inversion of each other and the data bits in the same position changes from 1 to 0 in every transaction.ep_size = 64 (S2/S3) and 512 (P4)
Checklist
Before submitting a Pull Request, please ensure the following: