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

zephyr: Added ZTEST for csp_rdp_queue_tx_size() function #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tanimitsudaiki
Copy link

@tanimitsudaiki tanimitsudaiki commented Sep 6, 2024

This commit tests the return value (queue size) of the csp_rdp_queue_tx_size() function under the following conditions:
・No packets are queued.
・One packet is added to the queue.
・One packet is removed from the queue.
・Packets are added up to the queue’s maximum limit.
・All packets are removed from the queue.
・The queue is flushed using the csp_rdp_queue_flush() function.
・The queue is not initialized.

Added the following test cases to test csp_rdp_queue_tx_size()

"test_rdp_queue_one"
Test that when a packet is added to an empty queue, the result of csp_rdp_queue_tx_add() becomes 1

"test_rdp_queue_enqueue_dequeue"
Test that after adding one packet to an empty queue and then removing it, the result of csp_rdp_queue_tx_add() becomes 0

"test_rdp_queue_MAX"
Add the definition for the queue's maximum size QUEUE_SIZE_MAX
Test that when packets are added up to the queue's maximum size, the result of csp_rdp_queue_tx_add() becomes the value of QUEUE_SIZE_MAX

"test_rdp_enqueue_MAX_and_dequeue"
Test that after adding packets up to the queue's maximum size and then removing all packets from the queue, the result of csp_rdp_queue_tx_add() becomes 0

Signed-off-by: Daiki Tanimitsu <[email protected]>
Added the following test cases to test csp_rdp_queue_tx_size() and csp_rdp_queue_rx_size()

"test_rdp_queue_flush"
Test that after flushing the queue with csp_rdp_queue_flush(), the result of csp_rdp_queue_tx_add() becomes 0
Added the enum definition csp_conn_type_t to initialize the csp_conn_t structure in this test

Signed-off-by: Daiki Tanimitsu <[email protected]>
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