Skip to content

test: add tests for deepin-reader batch 2 (20 bugs, 38 cases) - #416

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:test/pms-batch2-ut
Oct 9, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:test/pms-batch2-ut

Conversation

@add-uos

@add-uos add-uos commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Generated by qt-autotest-generator skill (PMS mining, Mode 7 -> Mode 2).
Baseline: master @ 9061ecb

概要

依据 PMS sev1/2 bug 修复历史补强 Google Test 回归用例(批次 2,接续 #411):
20 个 bug / 38 个用例,38/38 通过;全量 1264 用例 1263 通过。

用例分布

测试文件 用例数 覆盖 bug
tests/document/ut_pdfmodel.cpp 10 46911, 54210, 68550, 304111, 304471, 351271, 353429
tests/browser/ut_sheetbrowser.cpp 10 22093, 43216, 44136, 44264, 44491, 41018
tests/sidebar/ut_bookmarkwidget.cpp 5 10332, 12219
tests/uiframe/ut_centraldocpage.cpp 3 20978
tests/ut_application.cpp 3 44137, 44264
tests/browser/ut_browserword.cpp 2 40946
tests/browser/ut_browserpage.cpp 2 25004
tests/uiframe/ut_doctabbar.cpp 2 46381
tests/uiframe/ut_titlewidget.cpp 1 44136

另 2 个 bug(102352/347387)位于 htmltopdf main() 内 __sw_64__ 条件编译,x86 构建不可达,需申威环境手工验证。

覆盖率(lcov, reader/ 范围)

  • lines 84.7% (13106/15471)、functions 98.1% (1364/1390)
  • 本批次 21/21 目标函数 FNDA 全命中
  • 目标文件:BrowserWord 100% / PDFModel 92.1% / TitleWidget 90.0% / DocTabBar 87.4% / BookMarkWidget 87.1%

自测

  • 构建开启 --coverage,全量 test-deepin-reader 二进制运行 1264 用例
  • 新增用例命名 BUG<id>_<场景>,均带回溯注释(根因/回归意图)
  • 测试中新发现的源码缺陷(如 pinchTriggered 函数级 static 残留)留本地记录,不入库

Log: 补充 deepin-reader PMS 批次 2 单元测试(38 个回归用例)
Influence: 仅新增/追加测试文件,不修改被测源码与构建配置

Summary by Sourcery

Expand regression test coverage for the second batch of deepin-reader PMS issues without changing production code or build configuration.

Enhancements:

  • Expand Google Test regression coverage across PDF handling, browser interactions, bookmarks, shortcuts, tabs, title-bar focus behavior, and application keyboard events for 20 historical issues.

Tests:

  • Add 38 PMS-based regression test cases covering document corruption and persistence, coordinate transforms, annotation and gesture handling, bookmark synchronization, keyboard shortcuts, tab-close throttling, and button activation.

@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

This test-only batch adds 38 Google Test regressions covering 20 historical sev1/2 bugs across PDF handling, browser interactions, bookmarks, shortcuts, tab management, focus navigation, and application keyboard events. Tests combine real PDF fixtures, mocks/stubs, synthetic Qt events, timing checks, and coverage instrumentation; no production source or build configuration is changed. Review the fixture assumptions, event-state assertions, thread/deadlock test behavior, and ownership/lifetime handling, especially for tests relying on platform-specific paths or sw_64 code that remains untested on x86.

File-Level Changes

Change Details Files
Added PDF model regression coverage using real and mocked document/page states.
  • Covers malformed PDF handling and invalid-page guards.
  • Verifies text rectangle/text alignment, property stability, concurrent property access, and save failure propagation.
  • Validates saveAs output existence and PDF signature using temporary fixtures.
tests/document/ut_pdfmodel.cpp
Expanded browser interaction and layout regression tests for selection, coordinate conversion, menus, gestures, annotations, and page fitting.
  • Tests rotated coordinate mappings and rectangle scaling behavior.
  • Covers selectable word click suppression, annotation hit-test guards, context-menu cleanup, keyboard shortcuts, pinch zoom, and two-page scaling.
  • Uses stubs and synthetic Qt events to isolate interaction paths.
tests/browser/ut_browserpage.cpp
tests/browser/ut_browserword.cpp
tests/browser/ut_sheetbrowser.cpp
Added bookmark regression tests for model/UI synchronization and invalid-index safety.
  • Verifies bookmark add/remove state, persistence, null-sheet handling, and deletion behavior for valid and invalid selections.
tests/sidebar/ut_bookmarkwidget.cpp
Added document-level shortcut dispatch regression tests.
  • Checks Alt+2, Ctrl+1, and Ctrl+M dispatch to the current sheet and update its operation state.
tests/uiframe/ut_centraldocpage.cpp
Added tab-close throttling tests for rapid and delayed close requests.
  • Confirms duplicate close requests within the debounce interval are suppressed and requests after the interval are processed.
tests/uiframe/ut_doctabbar.cpp
Added title-bar focus-chain and keyboard handling regression coverage.
  • Validates focus policies and relative widget ordering.
  • Exercises Tab key handling without crashing.
tests/uiframe/ut_titlewidget.cpp
Added application-level keyboard event regression tests.
  • Verifies Return and keypad Enter emit button clicks and are consumed.
  • Exercises Alt+M context-menu event handling.
tests/ut_application.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 5 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tests/document/ut_pdfmodel.cpp" line_range="904-908" />
<code_context>
+    });
+
+    // 3 秒时限内必须完成(死锁则超时失败)
+    for (int i = 0; i < 300 && !(done1 && done2); ++i)
+        QThread::msleep(10);
+    EXPECT_TRUE(done1.load());
+    EXPECT_TRUE(done2.load());
+    t1.join();
+    t2.join();
+}
</code_context>
<issue_to_address>
**Deadlock test hangs indefinitely**

When either `properties()` worker remains blocked after the polling deadline, `EXPECT_TRUE` records the timeout, but `t1.join()` and `t2.join()` still wait for the blocked workers, so the test process never completes.

Run the deadlock check in a terminable subprocess or use a worker strategy that can be safely stopped after the deadline.
</issue_to_address>

### Comment 2
<location path="tests/document/ut_pdfmodel.cpp" line_range="893-898" />
<code_context>
+{
+    std::atomic<bool> done1(false), done2(false);
+    std::thread t1([this, &done1]() {
+        Properties p = m_tester->properties();
+        Q_UNUSED(p);
+        done1 = true;
</code_context>
<issue_to_address>
**Concurrent test has a data race**

When both worker calls overlap before the property cache is populated, `PDFDocument::properties()` checks and assigns `m_fileProperties` outside the mutex in `DPdfDoc::proeries()`, so concurrent calls access the cache unsynchronized and invoke undefined behavior.

Populate the cache before starting the workers, or otherwise synchronize access to the wrapper cache in this test.
</issue_to_address>

### Comment 3
<location path="tests/browser/ut_browserpage.cpp" line_range="911-912" />
<code_context>
+    QRectF screenRect = m_tester->translateRect(docRect);
+    EXPECT_TRUE(qFuzzyCompare(screenRect.width(), docRect.width() * 1.5));
+    // getNorotateRect 同链缩放(注释框回归文档坐标系时缩放链一致)
+    QRectF backRect = m_tester->getNorotateRect(screenRect);
+    EXPECT_TRUE(qFuzzyCompare(backRect.width(), screenRect.width() * m_tester->m_scaleFactor));
+
+    // 180°: 尺寸不变(仅平移), 缩放链保持
</code_context>
<issue_to_address>
**Coordinate round trip scales twice**

When the inverse coordinate mapping is incorrect, the test describes `getNorotateRect()` as restoring `docRect`, but expects `backRect.width()` to be `screenRect.width() * m_scaleFactor`; an extra scale therefore passes instead of detecting the broken round trip.

Compare the returned rectangle with the original `docRect` rather than expecting another scale multiplication.
</issue_to_address>

### Comment 4
<location path="tests/browser/ut_sheetbrowser.cpp" line_range="2878-2890" />
<code_context>
+    stub.set(ADDR(SheetBrowser, beginViewportChange), beginViewportChange_stub);
+
+    // 大宽度页面: 双页宽度预算未乘 2 时 scale 会反超单页
+    m_tester->m_items.at(0)->m_originSizeF = QSizeF(2000, 1000);
+    m_tester->m_items.at(1)->m_originSizeF = QSizeF(2000, 1000);
+
+    SheetOperation opSingle;
+    opSingle.scaleMode = Dr::FitToPageWidthMode;
+    opSingle.layoutMode = Dr::SinglePageMode;
+    m_tester->deform(opSingle);
+    double scaleSingle = m_tester->m_lastScaleFactor;
+
+    SheetOperation opDouble;
+    opDouble.scaleMode = Dr::FitToPageWidthMode;
+    opDouble.layoutMode = Dr::TwoPagesMode;
+    m_tester->deform(opDouble);
+    double scaleDouble = m_tester->m_lastScaleFactor;
+
</code_context>
<issue_to_address>
**Two-page scale regression passes**

When the tests run with the current fixture setup, `deform()` uses cached `m_maxWidth` and `m_maxHeight`, which these tests do not update after changing `m_originSizeF` (and are zero in the current fixture); the safety fallbacks do not exercise the large-page width budget. Also, `EXPECT_LE` accepts equal scales if the two-page divisor is removed.

Set up valid cached maxima after changing page sizes and assert a scale that distinguishes the two-page width budget from the single-page budget.

Also at `tests/browser/ut_sheetbrowser.cpp:2896`, `tests/browser/ut_sheetbrowser.cpp:2906-2924`.
</issue_to_address>

### Comment 5
<location path="tests/document/ut_pdfmodel.cpp" line_range="865" />
<code_context>
+
+    // 有文字的真实文档: 每个矩形对应一段文本, 数量严格一致
+    EXPECT_GT(charCount, 0);
+    EXPECT_EQ(rects.count(), texts.count());
+    EXPECT_LE(rects.count(), charCount);
+    // 注: DPdfPage 由 DPdfDoc(m_pages) 持有管理, 不可 delete (qDeleteAll 双重释放)
</code_context>
<issue_to_address>
**Empty text results pass alignment check**

When `allTextRects` reports a positive character count but returns empty `rects` and `texts`, `BUG68550_allTextRectsRectTextAligned` allows `rects` and `texts` to both be empty: equal empty lists satisfy the alignment assertion even when the real page has characters, so the test passes if the method returns no selection rectangles or text.

Assert that the output contains at least one rectangle and text entry for this known text-bearing fixture.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +904 to +908
for (int i = 0; i < 300 && !(done1 && done2); ++i)
QThread::msleep(10);
EXPECT_TRUE(done1.load());
EXPECT_TRUE(done2.load());
t1.join();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Deadlock test hangs indefinitely

When either properties() worker remains blocked after the polling deadline, EXPECT_TRUE records the timeout, but t1.join() and t2.join() still wait for the blocked workers, so the test process never completes.

Run the deadlock check in a terminable subprocess or use a worker strategy that can be safely stopped after the deadline.

Prompt for AI agents
In `tests/document/ut_pdfmodel.cpp` at lines 904-908:

**Deadlock test hangs indefinitely**

When either `properties()` worker remains blocked after the polling deadline, `EXPECT_TRUE` records the timeout, but `t1.join()` and `t2.join()` still wait for the blocked workers, so the test process never completes.

Run the deadlock check in a terminable subprocess or use a worker strategy that can be safely stopped after the deadline.

Comment on lines +893 to +898
Properties p = m_tester->properties();
Q_UNUSED(p);
done1 = true;
});
std::thread t2([this, &done2]() {
Properties p = m_tester->properties();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Concurrent test has a data race

When both worker calls overlap before the property cache is populated, PDFDocument::properties() checks and assigns m_fileProperties outside the mutex in DPdfDoc::proeries(), so concurrent calls access the cache unsynchronized and invoke undefined behavior.

Populate the cache before starting the workers, or otherwise synchronize access to the wrapper cache in this test.

Prompt for AI agents
In `tests/document/ut_pdfmodel.cpp` at lines 893-898:

**Concurrent test has a data race**

When both worker calls overlap before the property cache is populated, `PDFDocument::properties()` checks and assigns `m_fileProperties` outside the mutex in `DPdfDoc::proeries()`, so concurrent calls access the cache unsynchronized and invoke undefined behavior.

Populate the cache before starting the workers, or otherwise synchronize access to the wrapper cache in this test.

Comment on lines +911 to +912
QRectF backRect = m_tester->getNorotateRect(screenRect);
EXPECT_TRUE(qFuzzyCompare(backRect.width(), screenRect.width() * m_tester->m_scaleFactor));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Coordinate round trip scales twice

When the inverse coordinate mapping is incorrect, the test describes getNorotateRect() as restoring docRect, but expects backRect.width() to be screenRect.width() * m_scaleFactor; an extra scale therefore passes instead of detecting the broken round trip.

Compare the returned rectangle with the original docRect rather than expecting another scale multiplication.

Prompt for AI agents
In `tests/browser/ut_browserpage.cpp` at lines 911-912:

**Coordinate round trip scales twice**

When the inverse coordinate mapping is incorrect, the test describes `getNorotateRect()` as restoring `docRect`, but expects `backRect.width()` to be `screenRect.width() * m_scaleFactor`; an extra scale therefore passes instead of detecting the broken round trip.

Compare the returned rectangle with the original `docRect` rather than expecting another scale multiplication.

Comment on lines +2878 to +2890
m_tester->m_items.at(0)->m_originSizeF = QSizeF(2000, 1000);
m_tester->m_items.at(1)->m_originSizeF = QSizeF(2000, 1000);

SheetOperation opSingle;
opSingle.scaleMode = Dr::FitToPageWidthMode;
opSingle.layoutMode = Dr::SinglePageMode;
m_tester->deform(opSingle);
double scaleSingle = m_tester->m_lastScaleFactor;

SheetOperation opDouble;
opDouble.scaleMode = Dr::FitToPageWidthMode;
opDouble.layoutMode = Dr::TwoPagesMode;
m_tester->deform(opDouble);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Two-page scale regression passes

When the tests run with the current fixture setup, deform() uses cached m_maxWidth and m_maxHeight, which these tests do not update after changing m_originSizeF (and are zero in the current fixture); the safety fallbacks do not exercise the large-page width budget. Also, EXPECT_LE accepts equal scales if the two-page divisor is removed.

Set up valid cached maxima after changing page sizes and assert a scale that distinguishes the two-page width budget from the single-page budget.

Also at tests/browser/ut_sheetbrowser.cpp:2896, tests/browser/ut_sheetbrowser.cpp:2906-2924.

Prompt for AI agents
In `tests/browser/ut_sheetbrowser.cpp` at lines 2878-2890:

**Two-page scale regression passes**

When the tests run with the current fixture setup, `deform()` uses cached `m_maxWidth` and `m_maxHeight`, which these tests do not update after changing `m_originSizeF` (and are zero in the current fixture); the safety fallbacks do not exercise the large-page width budget. Also, `EXPECT_LE` accepts equal scales if the two-page divisor is removed.

Set up valid cached maxima after changing page sizes and assert a scale that distinguishes the two-page width budget from the single-page budget.

Also at `tests/browser/ut_sheetbrowser.cpp:2896`, `tests/browser/ut_sheetbrowser.cpp:2906-2924`.


// 有文字的真实文档: 每个矩形对应一段文本, 数量严格一致
EXPECT_GT(charCount, 0);
EXPECT_EQ(rects.count(), texts.count());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Empty text results pass alignment check

When allTextRects reports a positive character count but returns empty rects and texts, BUG68550_allTextRectsRectTextAligned allows rects and texts to both be empty: equal empty lists satisfy the alignment assertion even when the real page has characters, so the test passes if the method returns no selection rectangles or text.

Assert that the output contains at least one rectangle and text entry for this known text-bearing fixture.

Prompt for AI agents
In `tests/document/ut_pdfmodel.cpp` at line 865:

**Empty text results pass alignment check**

When `allTextRects` reports a positive character count but returns empty `rects` and `texts`, `BUG68550_allTextRectsRectTextAligned` allows `rects` and `texts` to both be empty: equal empty lists satisfy the alignment assertion even when the real page has characters, so the test passes if the method returns no selection rectangles or text.

Assert that the output contains at least one rectangle and text entry for this known text-bearing fixture.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
PR 标题 test: add tests for deepin-reader batch 2 (20 bugs, 38 cases)
修改文件 9 个测试文件(仅新增测试代码,不修改被测源码)
代码变更 +818 / -0
评分详情 本次PR仅新增测试代码(9个测试文件,818行新增),为20个PMS sev1/2 bug补充38个Google Test回归用例。代码注释完善、命名规范、逻辑清晰,无安全漏洞引入。安全扫描工具报告的4个发现经人工审计均为误报(2处为注释掉的Qt事件循环代码被误判为RCE,2处为PDF密码测试代码被误判为敏感信息泄露),且均位于已有代码中而非本次新增代码。

🔍 详细分析

1. 语法逻辑 ✓ — 25/25 分

评价词: 语法正确,逻辑清晰

潜在问题:
✓ 未发现明显问题

分析详情:

  • 所有测试用例使用正确的 C++ 和 Google Test 语法
  • Stub 框架使用正确,函数指针桩设置规范
  • 内存管理规范,new/delete 配对完整(如 ut_sheetbrowser.cpp 中 BrowserWord、PDFAnnotation、DocSheet 均正确释放)
  • BUG304111 并发测试正确使用 std::thread、std::atomic 和 join
  • BUG68550 测试正确注释了 DPdfPage 生命周期归 DPdfDoc 管理,避免双重释放
  • 各测试用例的断言(EXPECT_EQ/EXPECT_TRUE/EXPECT_FALSE/EXPECT_GT/EXPECT_LE)使用恰当

建议: 无


2. 代码质量 ✓ — 23/25 分

评价词: 代码结构清晰,注释完整

潜在问题:

  1. tests/uiframe/ut_centraldocpage.cpp 第1450-1514行:BUG20978_handleShortcutAlt2DispatchToCurrentSheet、BUG20978_handleShortcutCtrl1DispatchToCurrentSheet、BUG20978_handleShortcutCtrlMOpensSidebar 三个测试用例存在重复的初始化代码(Stub设置、UTSOURCEDIR路径构建、DocSheet创建),约7行重复,可提取为辅助函数或共享SetUp方法

分析详情:

  • 注释完整性优秀:每个测试块均有头部注释,包含 Bug ID、严重级别、历史根因、回归意图
  • 命名规范统一:测试用例遵循 BUG<id>_<scenario> 命名约定
  • 测试隔离性好:ut_sheetbrowser.cpp 中使用 b2_ 前缀的桩函数避免与既有全局桩重名
  • TestPDFDocumentReal fixture 设计合理,使用真实 PDF 文件测试
  • 代码重复轻微:仅 ut_centraldocpage.cpp 中 3 个测试存在初始化代码重复

建议: 建议将 ut_centraldocpage.cpp 中 BUG20978 系列测试的重复初始化代码提取为辅助函数,减少代码重复


3. 代码性能 ✓ — 20/20 分

评价词: 性能良好,资源使用合理

潜在问题:
✓ 未发现明显问题

分析详情:

  • 测试代码无性能瓶颈,算法复杂度均为 O(1) 或 O(n)(n为固定小常数)
  • BUG304111 并发测试设置 3 秒合理超时上限,足以检测死锁
  • BUG46381 防抖测试使用 QTest::qWait(150) 匹配 100ms 防抖窗口,合理必要
  • 所有动态分配资源在测试结束时正确释放

建议: 无


4. 代码安全 ✓ — 30/30 分

评价词: 存在0个安全漏洞

🔐 发现 0 个安全漏洞

安全漏洞详情:
✓ 未发现安全漏洞

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

安全扫描结果审计:
安全扫描工具报告 4 个潜在问题,经人工审计全部确认为误报:

编号 文件 行号 工具报告 审计结论
1 tests/browser/ut_sheetbrowser.cpp 1697 Critical - RCE (CWE-78) 误报:注释掉的 Qt 事件循环代码 //eventloop.exec(),非系统命令执行
2 tests/browser/ut_sheetbrowser.cpp 2237 Critical - RCE (CWE-78) 误报:同上,注释代码
3 tests/document/ut_pdfmodel.cpp 770 Critical - 硬编码密钥 (CWE-798) 误报:PDF 密码测试代码 password = "123",测试加密PDF加载逻辑
4 tests/document/ut_pdfmodel.cpp 770 High - 敏感信息泄露 (CWE-532) 误报:同上行,"password" 关键词误报

注:以上 4 处均位于已有代码中,非本次 PR 新增代码引入。OCR 审查因超时未产生结果。

建议: 无


💡 改进建议代码示例

// 建议将 ut_centraldocpage.cpp 中 BUG20978 系列测试的重复初始化提取为辅助方法

// 在 TestCentralDocPage 类中添加辅助方法:
// DocSheet* setupShortcutTestSheet() {
//     Stub s;
//     s.set(ADDR(CentralDocPage, getCurSheet), getCurSheet_stub2);
//     s.set(ADDR(ReaderImageThreadPoolManager, addgetDocImageTask), addgetDocImageTask_stub);
//     QString strPath = UTSOURCEDIR;
//     strPath += "/files/normal.pdf";
//     g_docsheet = new DocSheet(Dr::FileType::PDF, strPath, nullptr);
//     return g_docsheet;
// }

本报告由 AI 代码审查工具自动生成
扫描时间:2026-10-09 10:02:00

Generated by qt-autotest-generator skill (PMS mining, Mode 7 -> Mode 2).
Batch 2: SheetBrowser, BrowserPage, BrowserWord, BookMarkWidget,
CentralDocPage, DocTabBar, TitleWidget, Application, PDFModel/DPdfDoc.
Baseline: master @ 9061ecb "fix: walk the parent chain safely in
CentralDocPage" (2026-10-08)

Log: 补充 deepin-reader PMS 批次 2 单元测试(38 个回归用例)
Influence: 新增 20 个 sev1/2 bug 的回归用例 38 个,38/38 通过;
全量 1264 用例 1263 通过(1 个存量 flaky 与本批次无关)

依据 PMS bug 修复历史补强,按文件分布:
- tests/document/ut_pdfmodel.cpp +10 (46911/54210/68550/304111/
  304471/351271/353429)
- tests/browser/ut_sheetbrowser.cpp +10 (22093/43216/44136/44264/
  44491/41018)
- tests/sidebar/ut_bookmarkwidget.cpp +5 (10332/12219)
- tests/uiframe/ut_centraldocpage.cpp +3 (20978)
- tests/ut_application.cpp +3 (44137/44264)
- tests/browser/ut_browserword.cpp +2 (40946)
- tests/browser/ut_browserpage.cpp +2 (25004)
- tests/uiframe/ut_doctabbar.cpp +2 (46381)
- tests/uiframe/ut_titlewidget.cpp +1 (44136)

覆盖率(lcov, reader/ 范围):lines 84.7% (13106/15471),
functions 98.1% (1364/1390);21/21 目标函数 FNDA 全命中。

另 2 个 bug(102352/347387)位于 htmltopdf main() 内 __sw_64__
条件编译,x86 构建不可达,需申威环境手工验证。
测试中新发现的源码缺陷留本地记录,不入库。
@lzwind
lzwind force-pushed the test/pms-batch2-ut branch from 6af5765 to 1ec94bf Compare October 9, 2026 02:11
@add-uos

add-uos commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot

deepin-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This pr cannot be merged! (status: unstable)

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@add-uos

add-uos commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 78314f4 into linuxdeepin:master Oct 9, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants