test(modules): add unit tests for dbus, theme, widgets and startmanager - #506
Conversation
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's GuideAdds new GoogleTest-based unit tests covering DBus dock interfaces and related meta-types, theme model/view/panel behavior (including lambdas and animations), PathSettingWgt UI logic, and StartManager translation, drag, and QTimer-based lambdas to increase coverage of previously untested code paths. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ad16a10 to
63af614
Compare
Add tests for DBus interfaces, ThemeListModel, ThemeListView, ThemePanel, PathSettingWgt and StartManager lambda functions. Log: 新增dbus、theme、widgets和startmanager模块的单元测试 Influence: 覆盖DBus接口、主题面板等未覆盖函数
63af614 to
5821ba0
Compare
deepin pr auto review★ 总体评分:70分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 修复 ut_startmanager_lambdas.cpp 中的内存泄漏
static StartManager *freshStartManager()
{
if (StartManager::m_instance != nullptr) {
// 避免使用 deleteLater 导致的事件循环问题,直接 delete
delete StartManager::m_instance;
StartManager::m_instance = nullptr;
}
return StartManager::instance();
}
// 修复 ut_themelistmodel.cpp 中的临时文件清理
TEST(UT_ThemeListModel, data_and_initThemes)
{
QStringList paths = prepareTempThemes("de_themes_ut_model");
g_testThemesList.clear();
g_testThemesList << QFileInfo(paths[0]) << QFileInfo(paths[1]);
Stub s;
s.set((QFileInfoList(QDir::*)(QDir::Filters, QDir::SortFlags) const) ADDR(QDir, entryInfoList),
entryInfoListThemesStub);
ThemeListModel *model = new ThemeListModel;
// ... 原有测试逻辑 ...
delete model;
// 清理临时文件
for (const QString &path : paths) {
QFile::remove(path);
}
QDir().rmdir(QDir::tempPath() + "/de_themes_ut_model");
} |
|
[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 |
|
/merge |
Add tests for DBus interfaces, ThemeListModel, ThemeListView, ThemePanel, PathSettingWgt and StartManager lambda functions.
Log: 新增dbus、theme、widgets和startmanager模块的单元测试
Influence: 覆盖DBus接口、主题面板等未覆盖函数
Summary by Sourcery
Add unit tests to improve coverage of DBus interfaces, theme components, widget behavior, and StartManager lambdas.
Tests: