test: add SecurityDialog/autoCutText and expand ColorWidget/Model cov… - #300
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
…erage New tests in ut_securitydialog.cpp cover dialog construction, changeEvent (Font/Theme/Other), and the autoCutText free function with empty/null/ short/long text inputs. Extended ut_colorwidgetaction.cpp covers slotBtnClicked for every valid index, invalid index, default widget population, and separator property. Extended ut_model.cpp adds SearchResult helper coverage: empty/single/ multi-line sectionBoundingRect, setctionsFillText empty/with-content/ empty-callback cases. Extended ut_thumbnaildelegate.cpp covers drawBookMark with visible=false and a separate drawBookMark-not-visible case. 新增 ut_securitydialog.cpp,覆盖对话框构造、changeEvent (字体/主题/其他),以及 autoCutText 空串/null 标签/短文本/长文本 场景。 扩充 ut_colorwidgetaction.cpp,新增 slotBtnClicked 全索引遍历、 非法索引、defaultWidget 与 separator 属性验证用例。 扩充 ut_model.cpp,新增 SearchResult 辅助函数 sectionBoundingRect 与 setctionsFillText 的空/单行/多行/空回调场景用例。 扩充 ut_thumbnaildelegate.cpp,补充 drawBookMark(visible=false)。 Log: 补充 SecurityDialog/ColorWidget/Model/ThumbnailDelegate 测试用例 Influence: 单测从 882 增至 888,进一步提升 reader 模块边角函数覆盖率。
37bab82 to
e427a8e
Compare
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/tests/widgets/ut_colorwidgetaction.cpp b/tests/widgets/ut_colorwidgetaction.cpp
index 79478a7c..4372264c 100644
--- a/tests/widgets/ut_colorwidgetaction.cpp
+++ b/tests/widgets/ut_colorwidgetaction.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd.
+// Copyright (C) 2019-2026 UnionTech Software Technology Co.,Ltd.
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/tests/widgets/ut_securitydialog.cpp b/tests/widgets/ut_securitydialog.cpp
index f4e9804e..4dc428ee 100644
--- a/tests/widgets/ut_securitydialog.cpp
+++ b/tests/widgets/ut_securitydialog.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd.
+// Copyright (C) 2019-2026 UnionTech Software Technology Co.,Ltd.
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later |
|
[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 |
…erage
New tests in ut_securitydialog.cpp cover dialog construction, changeEvent (Font/Theme/Other), and the autoCutText free function with empty/null/ short/long text inputs.
Extended ut_colorwidgetaction.cpp covers slotBtnClicked for every valid index, invalid index, default widget population, and separator property. Extended ut_model.cpp adds SearchResult helper coverage: empty/single/ multi-line sectionBoundingRect, setctionsFillText empty/with-content/ empty-callback cases.
Extended ut_thumbnaildelegate.cpp covers drawBookMark with visible=false and a separate drawBookMark-not-visible case.
新增 ut_securitydialog.cpp,覆盖对话框构造、changeEvent
(字体/主题/其他),以及 autoCutText 空串/null 标签/短文本/长文本
场景。
扩充 ut_colorwidgetaction.cpp,新增 slotBtnClicked 全索引遍历、 非法索引、defaultWidget 与 separator 属性验证用例。
扩充 ut_model.cpp,新增 SearchResult 辅助函数 sectionBoundingRect 与 setctionsFillText 的空/单行/多行/空回调场景用例。
扩充 ut_thumbnaildelegate.cpp,补充 drawBookMark(visible=false)。
Log: 补充 SecurityDialog/ColorWidget/Model/ThumbnailDelegate 测试用例
Influence: 单测从 882 增至 888,进一步提升 reader 模块边角函数覆盖率。