-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[utest][audio]:Add standardized documentation for Audio Test #10975
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,24 +6,43 @@ | |||||
| * Change Logs: | ||||||
| * Date Author Notes | ||||||
| * 2025-05-01 wumingzi first version | ||||||
| * 2025-11-24 ChuanN-sudo add standardized utest documentation block | ||||||
| */ | ||||||
|
|
||||||
| /* The file can test the rt-thread audio driver framework including following api via memory | ||||||
| * simulation. | ||||||
| /** | ||||||
| * Test Case Name: Audio Test | ||||||
| * | ||||||
| * rt_audio_register | ||||||
| * rt_audio_rx_done | ||||||
| * rt_audio_tx_complete | ||||||
| * Test Objectives: | ||||||
| * - Validate RT-Thread audio driver framework registration and data flow mechanisms. | ||||||
| * - Verify audio playback (TX) and recording (RX) data transmission correctness. | ||||||
| * - Ensure proper buffer management and memory integrity during audio operations. | ||||||
| * - Test core APIs: rt_audio_register(), rt_audio_tx_complete(), rt_audio_rx_done() | ||||||
| * | ||||||
| * When audio devices generate or receive new data, the corresponding buffer in device will | ||||||
| * receive date from kernel or surroundings. The same phenomenon will also happen at the | ||||||
| * application level. Thus we can fill memory to simulate the generation of data then track | ||||||
| * and check memory to ensure kernel processing audio data correctly. And this depends on | ||||||
| * implementations of audio drivers. | ||||||
| * Test Scenarios: | ||||||
| * - Locate audio devices using SOUND_PLAYER_DEVICE_NAME and SOUND_MIC_DEVICE_NAME macros. | ||||||
| * - Write known byte patterns (0xAA, 0x55) to simulate audio data flow through TX/RX buffers. | ||||||
| * - Synchronize player and microphone test execution using audio_fsm_step state machine. | ||||||
| * - Test two consecutive block transfers for both TX and RX paths. | ||||||
| * | ||||||
| * Therefore, if the player_test testcase failed, it could mean rt_audio_register or | ||||||
| * rt_audio_tx_complete existing bugs. Similarly, if mic_test testcase failed, it could mean | ||||||
| * rt_audio_register or rt_audio_rx_done existing bugs. | ||||||
| * Verification Metrics: | ||||||
| * - Written audio data appears correctly in device TX buffers with exact byte patterns. | ||||||
| * - Data read from microphone device matches expected fill patterns (0xAA then 0x55) without corruption. | ||||||
| * - Buffer boundaries are respected with no overflow or underflow conditions. | ||||||
| * - Device open/close operations complete successfully without resource leaks. | ||||||
| * | ||||||
| * Dependencies: | ||||||
| * - Hardware requirements: QEMU emulator or any hardware platform that supports RT-Thread. | ||||||
| * - Software configuration: | ||||||
| * - RT_USING_UTESTCASES must be enabled (select "RT-Thread Utestcases" in menuconfig). | ||||||
|
||||||
| * - RT_USING_UTESTCASES must be enabled (select "RT-Thread Utestcases" in menuconfig). | |
| * - RT_USING_UTESTCASES must be enabled (select "RT-Thread Unit Test Cases" in menuconfig). |
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.
这里的描述按照menuconfig描述的
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.
🔴 [Date/日期]: Future dates in changelog / 变更日志中的未来日期
English: The dates "2025-05-01" and "2025-11-24" are in the future. Changelog dates must reflect the actual date when changes were made. Please update these to the correct historical dates.
中文:日期 "2025-05-01" 和 "2025-11-24" 是未来日期。变更日志日期必须反映实际修改时的日期。请更新为正确的历史日期。
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.
日期没问题