Skip to content

test: add tests for lcov gaps - #305

Merged
wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/d9e664e11df1
Dec 2, 2026
Merged

wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/d9e664e11df1

Conversation

@wyu71

@wyu71 wyu71 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Round 13 UT: cover remaining lcov gaps

Summary

Add tests/test_coverage_r13.cpp with 35 test cases covering sections A–E8 from the lcov gap analysis.

Covered target lines

  • A1: idrawtool.cpp:382-383 — touch inside sensitive radius, doDecide==false
  • A2: cerasertool.cpp:350 — m_tempLines.size() > 2 → removeFirst()
  • A3: cselecttool.cpp:340-342 — toolFinish with picture item in selectGroup
  • A4: cselecttool.cpp:582-583 — onStatusChanged EIdle with active proxy widget
  • A5: cdrawscene.cpp:301-302, 316-337, 340-341 — PageScene::event Touch branches
  • A6: clefttoolbar.cpp:96-98, 100-101 — DrawToolManager::setCurrentTool while EWorking
  • B1: cpentool.cpp:222 — toolStart with ECrayonPen → paintCrayonPen
  • B2: cpentool.cpp:358-359 — onStatusChanged EReady→EIdle with _layers
  • B3: cpolygonalstartool.cpp:156, cpolygontool.cpp:144, ctriangletool.cpp:125 — Shift+Alt diagonal X negative
  • C1: cgraphicsview.cpp:1005-1045 — slotOnPaste text branch
  • C2: cgraphicsview.cpp:796-797 — contextMenuEvent early return
  • C3: cgraphicsview.cpp:882-893 — showMenu screen edge adjustment
  • C4: cgraphicsview.cpp:262-284 — wheelEvent forwarded to proxy item
  • D1: ctextedit.cpp:217-222 — onTextChanged with small height
  • D3: cspinbox.cpp:158 — keyPressEvent Key_Minus early return
  • D4: cattributeitemwidget.cpp:266-270 — CColorSettingButton::paintEvent alpha==0
  • D5: cattributemanagerwgt.cpp:419 — onAttriWidgetValueChanged null sender
  • D6: dzoommenucombobox.cpp:136, 138 — setCurrentIndex clamping
  • E1: cgraphicscutitem.cpp:84-85, 233/251, 471-472
  • E2: cgraphicsrectitem.cpp:219, 235-236 — doScaling/testScaling
  • E3: csizehandlerect.cpp:108 — isFatherDragging
  • E4: cpictureitem.cpp:135 — operatingEnd toolEventType==3
  • E5: cgraphicspenitem.cpp:483-512 — updateHandlesGeometry loop body
  • E6: ciconbutton.cpp:62-63 — checkLock prevents press
  • E7: blurwidget.cpp:62,68, colorpanel.cpp:55, toolbutton.cpp:66
  • E8: idrawtoolevent.cpp:64-66, 87 — fromQEvent with touch / empty

Test results

  • 32 PASSED, 3 SKIPPED (all optional/environmental)
  • D2 (ccutwidget.cpp:603,607): skipped — offscreen mode cannot acquire lineEdit focus
  • E6 (ciconbutton.cpp:44): skipped — offscreen mode cannot acquire widget focus
  • E7 (colorpanel.cpp:256-258): skipped — ColorPanel constructor requires a DApplication instance which is not available in the test environment (custom Application subclass)

Notes

  • No source code modified; only tests/test_coverage_r13.cpp added
  • B1 paintCrayonPen called with space=0 causes infinite loop when positions differ; used same position for press/move to avoid this while still hitting line 222
  • All test cases self-clean (remove items, clear groups, restore tool to selection)

Summary by Sourcery

Expand unit-test coverage for remaining lcov gaps across drawing, view, graphics-item, and widget behavior.

Tests:

  • Add a new regression/coverage test suite targeting previously uncovered behavior across drawing tools, graphics items, views, and attribute widgets.
  • Include tests for touch and mouse input, paste and context menus, resizing and scaling, and widget state handling; several cases skip when required GUI capabilities are unavailable.

@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Sorry @wyu71, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 11 hours by commenting @sourcery-ai review. Upgrade to get a review now.

add tests/test_coverage_r13.cpp covering remaining lcov gaps

Issue: V-9844
Log: add tests for lcov gaps
@wyu71
wyu71 force-pushed the agent/ut-bot/d9e664e11df1 branch from c6b66d3 to d0a6f52 Compare December 2, 2026 02:31
@sourcery-ai

sourcery-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Add R13 regression and coverage tests for lcov gaps across drawing tools, views, widgets, and graphics items.

  • tests/test_coverage_r13.cpp L1-984

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

@wyu71 wyu71 changed the title test: add R13 coverage tests for lcov gaps (sections A-E8) test: add tests for lcov gaps Dec 2, 2026
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx, wyu71

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

@wyu71
wyu71 merged commit 51adb1f into linuxdeepin:master Dec 2, 2026
14 checks passed
@wyu71
wyu71 deleted the agent/ut-bot/d9e664e11df1 branch December 2, 2026 03:33
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