Repository navigation
test: extend dbus tests and add plugin/delegate tests - #563
Conversation
|
Sorry @pengfeixx, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 45 minutes by commenting |
Reviewer's GuideThis test-only PR substantially increases unit-test and function coverage by adding isolated filesystem, Qt event, rendering, process, singleton, and plugin-export scenarios across six test targets, with stubs and temporary resources used to drive success and failure branches. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
7aaef58 to
d36ba59
Compare
d36ba59 to
a019121
Compare
1. Extend ut_dldbushandler.cpp to cover all 22 public methods 2. Add ut_logviewer_truncate_main.cpp for the truncate tool entry 3. Extend plugin, delegate, detailedit and sharedmemory tests Log: No user-facing changes Influence: 1. Run deepin-log-viewer-test with --gtest_filter='*DLDBus*;*Plugin*' 2. Run deepin-log-viewer-plugin-test for the plugin suite 3. Check lcov function coverage of dldbushandler.cpp test: 扩展DBus测试并新增插件与委托测试 1. 扩展 ut_dldbushandler.cpp,覆盖全部 22 个公开方法 2. 新增 ut_logviewer_truncate_main.cpp 裁剪工具入口测试 3. 扩展插件、委托、详情编辑与共享内存测试 Log: 无用户可见变化 Influence: 1. 运行 deepin-log-viewer-test 过滤 DLDBus/Plugin 套件 2. 运行 deepin-log-viewer-plugin-test 插件测试 3. 用 lcov 检查 dldbushandler.cpp 函数覆盖率
a019121 to
7aea34e
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['无语法逻辑问题,建议保持当前测试规范。'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['将 getOtherFileInfo_home_branch 的恒真断言替换为有意义的验证,如 EXPECT_TRUE(result.isEmpty()) 或对结果内容的具体检查', '考虑在 UT_DLDBusHandler::SetUp 中设置 Utils::homePath = m_homeDir.path(),减少各测试用例中的重复代码'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['无性能问题。'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['无安全问题,测试代码安全合规。'] 💡 改进建议代码示例// 建议:将 getOtherFileInfo_home_branch 中的恒真断言替换为有意义的验证
TEST_F(UT_DLDBusHandler, getOtherFileInfo_home_branch)
{
Utils::homePath = m_homeDir.path();
QStringList result = m_handler->getOtherFileInfo(Utils::homePath, false);
// 替换恒真断言为具体验证
EXPECT_TRUE(result.isEmpty());
}
// 建议:在 SetUp 中统一设置 Utils::homePath,减少重复
void SetUp() override
{
m_oldHome = Utils::homePath;
Utils::homePath = m_homeDir.path(); // 统一设置默认 home 路径
m_handler = new DLDBusHandler();
ASSERT_NE(m_handler, nullptr);
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.5.43 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx 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 |
Part 5/8 of the deepin-log-viewer unit-test coverage series (single-commit PR; all 8 PRs touch disjoint file sets and are mutually independent).
Files in this PR (6 files, +1344/-118 lines)
tests/dbusproxy/ut_dldbushandler.cpptests/src/ut_logviewitemdelegate.cpptests/ut_logviewerplugin/ut_logViewerPlugin.cpptests/src/ut_logdetailedit.cpptests/src/ut_logviewer_truncate_main.cpp(new)tests/src/ut_sharedmemorymanager.cppNotes
tests/src//tests/dbusproxy//tests/ut_logviewerplugin/, globbed automatically bytests/CMakeLists.txt(re-run cmake after pulling).Summary by Sourcery
Increase unit-test coverage across core log viewer components and command-line behavior.
Enhancements:
Tests: