Repository navigation
test(ut): add PMS regression tests for sev1/sev2 bug hotspots - #941
deepin-bot[bot] merged 1 commit into
Conversation
Reviewer's GuideThis PR adds 13 PMS-linked regression tests in five batch headers, reusing established fixtures and access wrappers to exercise 12 sev1/sev2 bug-fix hotspots without production-code changes, then wires the batches into the aggregate unit-test build. Reviewers should focus on whether each test meaningfully asserts the documented fix rather than only absence of crashes, and on lifecycle/cleanup safety in the GStreamer and RecordProcess cases. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/ut_screen_shot_recorder/ut_pms_regression_batch2.h" line_range="43-49" />
<code_context>
+ ASSERT_NE(m_p, nullptr);
+
+ // Act — 触发转码回调(修复点:QProcess 父挂 this)
+ EXPECT_NO_FATAL_FAILURE(
+ call_private_fun::RecordProcessonTranscodePaletteFinished(
+ *m_p, QStringLiteral("/tmp/ut_pms_nonexistent_308389.png")));
+
+ // Assert — 对象存活(QProcess 随父托管,未泄漏致 OOM)
+ EXPECT_NE(m_p, nullptr);
+}
+
+// =========================================================================
</code_context>
<issue_to_address>
**issue (testing):** The test only checks that `m_p` remains non-null immediately after starting ffmpeg; it never verifies that the created `QProcess` is parented, exits, or is destroyed. A regression that allocates an unparented process would still pass this test, so the claimed no-leak protection is not covered.
**Triggers:** When the process is asynchronous, which is the normal behavior of `QProcess::start`.
**Suggested fix:** Inspect the created process's parent or child-object list and wait for deterministic cleanup, or expose a test seam that verifies process ownership and destruction.
</issue_to_address>28b2a41 to
9f9bc76
Compare
基于 PMS 缺陷热点补强(qt-autotest-generator Mode 7),对 sev1/sev2 高频缺陷
修复路径补强回归用例,防止退化。用例按所属 fixture 归入既有测试文件,不另建
批次文件。
新增 13 个 PMS 命名回归用例,覆盖 12 个 BUG(3 sev1 + 9 sev2),全部编译运行通过:
MainWindowCov4Test:
BUG185721_StartCountdownNoSegfault (sev1, startCountdown)
BUG275661_InitAttributesScreenLayerIdempotent (sev2, initAttributes)
BUG280187_InitTreelandtAttributesIdempotent (sev2, initTreelandtAttributes)
BUG352125_InitMainWindowNoCrash (sev2, initMainWindow)
PixMergeCovTest:
BUG314667_EmptyImageGuardReturnsFalse (sev1, mergeImageWork 空图守卫)
GstRecordXTest:
BUG129883_WaylandGstStartRecordBgraNoCrash (sev2, waylandGstStartRecord BGRA)
RecordProcessCov2Test:
BUG308389_OnTranscodePaletteFinishedNoLeak (sev2, onTranscodePaletteFinished OOM)
BUG291463_SetRecordInfoStoresRect (sev2, setRecordInfo)
BUG283491_RecordVideoNoCrash (sev2, recordVideo)
BUG172577_OnTranscodeFinishNoCrash (sev2, onTranscodeFinish)
BUG308389_DestructorNoCrash (sev2, ~RecordProcess)
SubToolWidgetCov2Test:
BUG308909_InitRecordOptionNoCrash (sev2, initRecordOption gif 选项)
VoiceVolumeWatcherCovTest:
BUG79399_ConstructorNoHangAndSlotSafe (sev1, 启动卡死)
复用既有 fixture 与 ACCESS_PRIVATE_FUN/FIELD 包装器;仅 SubToolWidget::
initRecordOption 为新增声明(全仓唯一,无 ODR 冲突)。每例头部带 PMS URL +
commit sha + 根因注释,可追溯。
验证: [ PASSED ] 13 tests. (698 ms)
9f9bc76 to
d74b9f2
Compare
|
[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 |
|
/merge |
背景
基于 PMS 缺陷热点补强(qt-autotest-generator Mode 7),对 sev1/sev2 高频缺陷修复路径补强回归用例,防止退化。
改动内容
新增 13 个 PMS 命名回归用例(5 个批次头文件),覆盖 12 个 sev1/sev2 BUG 修复路径,全部编译运行通过。
测试验证
质量保证
ACCESS_PRIVATE_FUN/FIELD包装器,零 ODR 冲突风险Summary by Sourcery
Strengthen unit-test coverage against high-priority PMS regression hotspots with 13 named sev1/sev2 tests.
Enhancements:
Build:
Tests: