test: add unit tests for MLogger and HeaderInfoTableDelegate - #759
Merged
deepin-bot[bot] merged 1 commit intoSep 16, 2026
Merged
Conversation
Reviewer's GuideAdds 16 unit tests covering MLogger rule handling and HeaderInfoDelegate painting branches, using DConfig/DApplication stubs and Qt widget fixtures, and ignores the File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning
详情 {
"unset": {
"deepin-devicemanager/tests/src/LogConfigRead/ut_mlogger.cpp": {
"b": [
" // MLogger ctor reads QT_LOGGING_RULES then unsets it.",
" qunsetenv(\"QT_LOGGING_RULES\");"
]
}
}
} |
- Add ut_mlogger.cpp covering MLogger constructor env-var reading, semicolon-to-newline replacement, setRules/appendRules/rules() and destructor safety - Add ut_headerinfotabledelegate.cpp covering HeaderInfoTableDelegate constructor and paint in normal/selected/inactive states - Fix memory leak in UT_MLogger::TearDown by deleting the DConfig object created in SetUp 测试(单元测试): 为 MLogger 和 HeaderInfoTableDelegate 添加单元测试 - 新增 ut_mlogger.cpp,覆盖 MLogger 构造函数环境变量读取、分号到换行符替换、setRules/appendRules/rules() 及析构函数安全性 - 新增 ut_headerinfotabledelegate.cpp,覆盖 HeaderInfoTableDelegate 构造函数及正常/选中/非激活状态下的 paint 绘制 - 修复 UT_MLogger::TearDown 中未释放 DConfig 对象的内存泄漏 Log: 为 MLogger 日志配置类和 HeaderInfoTableDelegate 添加单元测试,修复 TearDown 内存泄漏
add-uos
force-pushed
the
agent/agent/b8cd6c5fae76
branch
from
September 16, 2026 08:34
08e0cf1 to
b3d9e28
Compare
|
Warning
详情 {
"unset": {
"deepin-devicemanager/tests/src/LogConfigRead/ut_mlogger.cpp": {
"b": [
" // MLogger ctor reads QT_LOGGING_RULES then unsets it.",
" qunsetenv(\"QT_LOGGING_RULES\");"
]
}
}
} |
lzwind
approved these changes
Sep 16, 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 |
Contributor
|
This pr force merged! (status: unstable) |
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.
Summary
为 deepin-devicemanager 项目补充两个模块的单元测试:
tests/src/LogConfigRead/ut_mlogger.cpp):覆盖构造函数环境变量读取与分号替换、setRules分号→换行符替换、appendRules追加/去重/空输入/混合输入、rules()getter、析构函数不崩溃,共 12 个用例tests/src/Widget/ut_headerinfotabledelegate.cpp):覆盖构造函数、paint 非 selected 状态、paint selected 状态、paint 无活跃窗口(Inactive palette 路径),共 4 个用例同时将
.ut/工作目录加入.gitignore。Test
Summary by Sourcery
Add unit tests for logging rule management and header table delegate rendering, and exclude test artifacts from version control.
Tests:
Chores: