-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[utest]: [signal]: Add Standardized function comment blocks. #10914
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: kernelReviewers: GorrayLi ReviewSun hamburger-os lianux-mm wdfk-prog xu18838022837 Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-11-10 19:31 CST)
📝 Review Instructions
|
Added comments to the utest for the signal module, including: test purpose, usage scenarios, dependency configurations, expected outcomes, and expected behaviors. Signed-off-by: Mengchen Teng <[email protected]>
772bd03 to
13a57ca
Compare
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.
Pull Request Overview
This pull request adds comprehensive documentation to the signal test case file (signal_tc.c), providing detailed explanations of test objectives, scenarios, verification metrics, dependencies, and expected results for RT-Thread's signal functionality testing.
Key Changes
- Added extensive documentation header (lines 21-128) describing test objectives, scenarios, verification metrics, dependencies, and expected results for all signal test functions
- Documentation covers 6 test functions:
rt_signal_install_test,rt_signal_mask_test,rt_signal_unmask_test,rt_signal_kill_test,rt_signal_wait_test, andrt_signal_wait_test2
src/utest/signal_tc.c
Outdated
| * - "sig_t1" is waiting for the signal, and then sends the SIGUSR1 signal to "sig_t1" using | ||
| * - rt_thread_kill. The main thread then waits on the _received_signal semaphore, which will be | ||
| * - released by "sig_t1" upon receiving the signal. Finally, the test case verifies that the | ||
| * - recive_sig variable is set to SIGUSR1, confirming that the signal was successfully |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - [rt_signal_kill_test]: In Case7, every signo shall correctly trigger the signal handler, | ||
| * - such that recive_sig equals signo. In Case9, rt_signal_kill shall return -RT_EINVAL. | ||
| * | ||
| * - [rt_signal_wait_test]: In Case5, recive_sig shall equal SIGUSR1, indicating that the waiting |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - functionality. The registration of the signal handler should be completed correctly. | ||
| * - Include Case1 and Case2. | ||
| * | ||
| * - [rt_signal_mask_test]: Verify the correctness of the rt_signal_unmask functions's |
Copilot
AI
Nov 10, 2025
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.
Documentation Issue / 文档问题
English: Line 28 states this test verifies "rt_signal_unmask" but it should be "rt_signal_mask". The function name "rt_signal_mask_test" tests the unmask functionality (when signals are unmasked and should be received), not the mask functionality.
中文:第 28 行说明该测试验证 "rt_signal_unmask" 函数,但应该是 "rt_signal_mask"。函数名 "rt_signal_mask_test" 测试的是 unmask 功能(信号取消屏蔽后应该被接收),而非 mask 功能。
| * - [rt_signal_mask_test]: Verify the correctness of the rt_signal_unmask functions's | |
| * - [rt_signal_mask_test]: Verify the correctness of the rt_signal_mask function's |
| * - value of recive_sig does not equal the value of signo. | ||
| * | ||
| * - [rt_signal_kill_test]: Case7(the for Loop) is the same as the loop in [rt_signal_mask_test]. | ||
| * - Case9 Verifies that when an invalid signal is sent using rt_signal_kill, the function returns |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "Verifieds" is grammatically incorrect. It should be "Verifies" (third person singular present tense).
中文:单词 "Verifieds" 语法错误,应为 "Verifies"(第三人称单数现在时)。
| * - Case9 Verifies that when an invalid signal is sent using rt_signal_kill, the function returns | |
| * - Case9 verifies that when an invalid signal is sent using rt_signal_kill, the function returns |
src/utest/signal_tc.c
Outdated
| * - signal signo. After successful registration, the specified signal mask is unmasked using | ||
| * - rt_signal_unmask, then masked again using rt_signal_mask. A signal is then sent to rt_thread_self | ||
| * - via rt_thread_kill. After a 1ms delay, the signal callback function is not triggered, and the | ||
| * - value of recive_sig does not equal the value of signo. |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - that recive_sig equals signo. | ||
| * | ||
| * - [rt_signal_unmask_test]: Every signo shall not trigger the signal handler after masking, | ||
| * - such that recive_sig does not equal signo. |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - such that recive_sig does not equal signo. | ||
| * | ||
| * - [rt_signal_kill_test]: In Case7, every signo shall correctly trigger the signal handler, | ||
| * - such that recive_sig equals signo. In Case9, rt_signal_kill shall return -RT_EINVAL. |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - [rt_signal_wait_test]: In Case5, recive_sig shall equal SIGUSR1, indicating that the waiting | ||
| * - thread successfully received the signal. And main thread can take the semaphore. | ||
| * | ||
| * - [rt_signal_wait_test2]: In Case6, recive_sig shall not equal SIGUSR1, indicating that the waiting |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
src/utest/signal_tc.c
Outdated
| * - functionality. The signal handler will only be triggered when the signal is unmasked. | ||
| * - Include Case3. | ||
| * | ||
| * - [rt_signal_unmask_test]: Verify the correctness of the rt_signal_mask functions's |
Copilot
AI
Nov 10, 2025
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.
Documentation Issue / 文档问题
English: Line 32 states this test verifies "rt_signal_mask" but it should be "rt_signal_unmask". The function name "rt_signal_unmask_test" tests the mask functionality (when signals are masked and should NOT be received), not the unmask functionality.
中文:第 32 行说明该测试验证 "rt_signal_mask" 函数,但应该是 "rt_signal_unmask"。函数名 "rt_signal_unmask_test" 测试的是 mask 功能(信号被屏蔽后不应该被接收),而非 unmask 功能。
| * - [rt_signal_unmask_test]: Verify the correctness of the rt_signal_mask functions's | |
| * - [rt_signal_unmask_test]: Verify the correctness of the rt_signal_mask function's |
src/utest/signal_tc.c
Outdated
| * - registered via rt_signal_install, where receive_sig is assigned the value of the triggered | ||
| * - signal signo. After successful registration, the specified signal mask is unmasked using | ||
| * - rt_signal_unmask, and a signal is sent to rt_thread_self via rt_thread_kill. After a 1ms | ||
| * - delay, the signal callback function is triggered successfully, and the value of recive_sig |
Copilot
AI
Nov 10, 2025
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.
Spelling Error / 拼写错误
English: The word "recive_sig" is misspelled. It should be "receive_sig" (missing the second 'e').
中文:单词 "recive_sig" 拼写错误,应为 "receive_sig"(缺少第二个 'e')。
…ng mistakes, and ambiguities in function names. Fixed the issue of grammatical errors in words; changed the variable 'recive_sig' to 'receive_sig'. Originally, rt_signal_unmask_test was testing the masking function of rt_signal_mask, while rt_signal_mask_test was verifying whether signals could be sent correctly during unmasking——the function names were exactly opposite to their functions. Now the two function names have been swapped, and the corresponding comments have also been updated accordingly.After modification, it has been verified that the signal-related utests can be executed correctly. Signed-off-by: Mengchen Teng <[email protected]>
已修改,见commit 394df75 |
Added comments to the utest for the signal module, including: test purpose, usage scenarios, dependency configurations, expected outcomes, and expected behaviors.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Add more detailed descriptions to the unit test (utest) files for the signal module.
你的解决方案是什么 (what is your solution)
Read and understand the source code, then add explanations.
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up