Repository navigation
test(unittest): align setBackingUpDriverUI test with fixed progress semantics - #916
Merged
deepin-bot[bot] merged 1 commit intoOct 26, 2026
Merged
Conversation
…emantics The * 10 progress scaling defect in setBackingUpDriverUI was fixed on master (PR linuxdeepin#877), so SetBackingUpDriverUI_Called_ProgressScaledByTen asserting the buggy value 50 now fails. Rename it to SetBackingUpDriverUI_Called_ProgressUsesValueAsIs and expect the value written as-is (5). Also refresh stale comments about the unchecked dynamic_cast<DStyle*> now that sectionSizeHint has a null guard. Verified against current master: 136/136 cases pass (36+53+47) and the DetectedStatusWidget suite now exits cleanly.
Reviewer's guide (collapsed on small PRs)Reviewer's Guide本 PR 仅更新两个单元测试源码文件:将 setBackingUpDriverUI 测试对齐到修复后的原样进度语义,并修正 DriverTableView 测试中关于 DStyle 与 dynamic_cast 的过时注释;不涉及生产代码变更,基于最新 master 验证 136/136 个相关用例通过且三个测试套件正常退出。 File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 本次变更已正确,无需修复。示例(保持当前写法): // Act: 正在备份界面(进度 5/10, 进度条直接使用传入值) w->setBackingUpDriverUI("RTL8168", 10, 5); // Assert: 进度值按原样写入(源码已移除错误的 ×10 缩放) EXPECT_EQ(w->mp_Progress->value(), 5);本报告由 AI 代码审查工具自动生成 |
lzwind
approved these changes
Oct 26, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
PR #877 在 master 修复了
setBackingUpDriverUI的进度 ×10 缺陷后, 单测中编码旧缺陷行为的用例随之失效:SetBackingUpDriverUI_Called_ProgressScaledByTen(断言 ×10 后的 50)在当前 master 上失败SetBackingUpDriverUI_Called_ProgressUsesValueAsIs并断言修正后的语义(进度值按原样写入, 5)sectionSizeHint测试中已过时的"源码 dynamic_cast 未判空"注释(判空已由 PR fix: add null check, fix progress value and destructor order in devicemanager #877 合入)仅改 2 个测试源码文件, 不含生产代码变更。
验证
基于最新 master(54e136b)本地验证: 136/136 用例通过(DetectedStatusWidget 36 + DriverTableView 53 + DetailTreeView 47), 且 DetectedStatusWidget / DriverTableView / DetailTreeView 三个套件进程退出码均为 0(#877 的析构顺序修复使此前的退出阶段崩溃不再出现)。
Summary by Sourcery
Align unit tests with the corrected backup progress semantics and current style-handling behavior.
Enhancements:
Tests: