[utest][smp]Add descriptions for the SMP test cases (interrupt_pri and spinlock)#11011
[utest][smp]Add descriptions for the SMP test cases (interrupt_pri and spinlock)#11011Rbb666 merged 2 commits intoRT-Thread:masterfrom
Conversation
Add comments for smp_interrupt_pri. Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
|
👋 感谢您对 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-12-09 21:40 CST)
📝 Review Instructions
|
c57b3c3 to
a5c88dd
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test case descriptions to two SMP (Symmetric Multi-Processing) unit test files. The descriptions follow a structured format including test objectives, scenarios, verification metrics, dependencies, and expected results.
Key Changes:
- Added detailed documentation blocks for the spinlock test case
- Added detailed documentation blocks for the interrupt priority test case
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/utest/smp/smp_spinlock_tc.c | Added structured test case description including objectives, scenarios, and expected results for spinlock protection testing |
| src/utest/smp/smp_interrupt_pri_tc.c | Added structured test case description including objectives, scenarios for interrupt priority handling in two different modes |
| * @brief Spinlock testcase. | ||
| * | ||
| * @note Create multiple threads and use spinlocks to protect shared memory | ||
| * |
There was a problem hiding this comment.
🟡 PR Title / PR 标题: Missing prefix format / 缺少前缀格式
English: PR title should follow format: [module][subsystem] Description in lowercase.
Current title: "Add descriptions for the SMP test cases (interrupt_pri and spinlock)".
Based on modified files in src/utest/smp/, suggested title: [utest][smp] Add descriptions for interrupt_pri and spinlock test cases.
中文:PR 标题应遵循格式:小写的 [模块][子系统] 描述。
当前标题:"Add descriptions for the SMP test cases (interrupt_pri and spinlock)"。
基于修改的文件在 src/utest/smp/,建议标题:[utest][smp] Add descriptions for interrupt_pri and spinlock test cases。
src/utest/smp/smp_spinlock_tc.c
Outdated
| * - RT_USING_SMP needs to be enabled. | ||
| * | ||
| * Expected Results: | ||
| * - You will see the the PASS message of smp_interrupt_pri_tc. |
There was a problem hiding this comment.
English: Spelling error - duplicate word "the". Should be "You will see the PASS message of smp_spinlock_tc."
中文:拼写错误 - 重复的单词 "the"。应为 "You will see the PASS message of smp_spinlock_tc."
| * - You will see the the PASS message of smp_interrupt_pri_tc. | |
| * - You will see the PASS message of smp_spinlock_tc. |
src/utest/smp/smp_spinlock_tc.c
Outdated
| * - RT_USING_SMP needs to be enabled. | ||
| * | ||
| * Expected Results: | ||
| * - You will see the the PASS message of smp_interrupt_pri_tc. |
There was a problem hiding this comment.
English: Incorrect test case reference. The expected result refers to "smp_interrupt_pri_tc" but this is the spinlock test case. It should refer to "smp_spinlock_tc" instead, matching line 33 which mentions "core.smp_spinlock".
中文:错误的测试用例引用。预期结果引用了 "smp_interrupt_pri_tc",但这是 spinlock 测试用例。应该引用 "smp_spinlock_tc",以匹配第 33 行提到的 "core.smp_spinlock"。
| * - You will see the the PASS message of smp_interrupt_pri_tc. | |
| * - You will see the PASS message of smp_spinlock_tc. |
src/utest/smp/smp_spinlock_tc.c
Outdated
| * - then voluntarily enters a sleep state. After being awakened, it executes number2++ and finally | ||
| * - releases the spin lock. Thread 2, upon acquiring the spin lock, first checks whether number1 is | ||
| * - equal to number2, then performs number1++ and number2++ operations, and ultimately releases the | ||
| * - spin lock. Within Thread 2, if the judgment condition number >= 10 is satisfied, finish_flag is set to 1. |
There was a problem hiding this comment.
English: Inconsistent naming in documentation. The variable name in the code is "finsh_flag" (line 47), but the documentation refers to it as "finish_flag" in line 30. Please use the actual variable name "finsh_flag" in the documentation for accuracy.
中文:文档中的命名不一致。代码中的变量名是 "finsh_flag"(第 47 行),但文档在第 30 行引用为 "finish_flag"。请在文档中使用实际的变量名 "finsh_flag" 以确保准确性。
| * - spin lock. Within Thread 2, if the judgment condition number >= 10 is satisfied, finish_flag is set to 1. | |
| * - spin lock. Within Thread 2, if the judgment condition number >= 10 is satisfied, finsh_flag is set to 1. |
Add comments for smp_spinlock_tc. Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
a5c88dd to
751e9b9
Compare
|
已修改 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Add descriptions for the SMP test cases (interrupt_pri and spinlock)
你的解决方案是什么 (what is your solution)
请提供验证的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