Skip to content

test: add UT for tools/widgets/attribute panel coverage - #304

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

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

Conversation

@wyu71

@wyu71 wyu71 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Add test_tools_coverage_r12.cpp and test_text_attr_coverage_r12.cpp
covering A1-A6, B1-B5, C1-C5, D1-D5, E1-E10 target lines:
A1: idrawtool.cpp:382-383 (touch radius, selection tool)
A2: cdrawscene.cpp:283-284 (doLeave interrupt)
A3: cgraphicsview.cpp:796-797 (contextMenuEvent guard)
A4: cviewmanagement.cpp:386 (IN_MOVE_SELF → EFileMoved)
A5: cgraphicstextitem.cpp:150 (changToEditState show)
A6: cpicturetool.cpp:179 (auto-fit already matched)
B1: cselecttool.cpp:148 (cancel group button)
B2: cselecttool.cpp:208-209 (press selected item)
B3: cselecttool.cpp:340-342 (toolFinish picture attrs)
B4: cselecttool.cpp:364-370 (double-click text edit)
B5: cselecttool.cpp:582-583 (onStatusChanged EIdle)
C1: ellipse/polygonalStar/polygon/triangle toolCreatItemFinish
C2: Shift+Alt negative width proportional branch
C3: creatItem right button returns nullptr
C4: pen tool crayon/layers/getViewDefualtPen
C5: eraser tempLines/group saveZ
D1: ctexttool.cpp:280-283 (font family re-assign)
D4: ctextedit.cpp:412-418 (selection format conflict)
D5: ctextedit.cpp:217-222 (auto-wrap height)
E1: ccuttool.cpp:101-102 (invalid var count)
E2: ccuttool.cpp:426-429 (Enter key confirm)
E3: ccutwidget.cpp:589-591 (height ratio table)
E4: ccutwidget.cpp:603/607 (done click focus)
E5: ccutwidget.cpp:207-210 (ParentChange non-window)
E6: cattributemanagerwgt.cpp:290-302 (DISABLED - source bug at line 302)
E7: cattributemanagerwgt.cpp:218 (hidden attr change show)
E9: cattributeitemwidget.cpp:266-270/665/702
E10: cspinbox.cpp:158, toptoolbar.cpp:123, dzoommenucombobox.cpp:95-138

Issue: V-9675
Log: add UT for tools/widgets/attribute panel coverage

Summary by Sourcery

Expand unit-test coverage for drawing tools, text editing, and attribute-panel interactions.

Tests:

  • Add two round-12 unit-test files covering drawing tools, text editing, attribute panels, and zoom controls.
  • Exercise additional interaction and edge-case paths across selection, shape, pen, eraser, and crop tools; one unstable attribute-manager case is disabled.

@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 hour and 50 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

Add test_tools_coverage_r12.cpp and test_text_attr_coverage_r12.cpp
covering A1-A6, B1-B5, C1-C5, D1-D5, E1-E10 target lines:
A1: idrawtool.cpp:382-383 (touch radius, selection tool)
A2: cdrawscene.cpp:283-284 (doLeave interrupt)
A3: cgraphicsview.cpp:796-797 (contextMenuEvent guard)
A4: cviewmanagement.cpp:386 (IN_MOVE_SELF → EFileMoved)
A5: cgraphicstextitem.cpp:150 (changToEditState show)
A6: cpicturetool.cpp:179 (auto-fit already matched)
B1: cselecttool.cpp:148 (cancel group button)
B2: cselecttool.cpp:208-209 (press selected item)
B3: cselecttool.cpp:340-342 (toolFinish picture attrs)
B4: cselecttool.cpp:364-370 (double-click text edit)
B5: cselecttool.cpp:582-583 (onStatusChanged EIdle)
C1: ellipse/polygonalStar/polygon/triangle toolCreatItemFinish
C2: Shift+Alt negative width proportional branch
C3: creatItem right button returns nullptr
C4: pen tool crayon/layers/getViewDefualtPen
C5: eraser tempLines/group saveZ
D1: ctexttool.cpp:280-283 (font family re-assign)
D4: ctextedit.cpp:412-418 (selection format conflict)
D5: ctextedit.cpp:217-222 (auto-wrap height)
E1: ccuttool.cpp:101-102 (invalid var count)
E2: ccuttool.cpp:426-429 (Enter key confirm)
E3: ccutwidget.cpp:589-591 (height ratio table)
E4: ccutwidget.cpp:603/607 (done click focus)
E5: ccutwidget.cpp:207-210 (ParentChange non-window)
E6: cattributemanagerwgt.cpp:290-302 (DISABLED - source bug at line 302)
E7: cattributemanagerwgt.cpp:218 (hidden attr change show)
E9: cattributeitemwidget.cpp:266-270/665/702
E10: cspinbox.cpp:158, toptoolbar.cpp:123, dzoommenucombobox.cpp:95-138

Issue: V-9675
Log: add UT for tools/widgets/attribute panel coverage
@wyu71
wyu71 force-pushed the agent/ut-bot/fa67fdce5eac branch from 6f962ef to a30db6a Compare December 1, 2026 03:45
@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Add coverage tests for drawing-tool behavior, including selection, shape creation, pen, and eraser paths.

  • tests/test_tools_coverage_r12.cpp L1-835

Add coverage tests for text editing, cut controls, and attribute-panel behavior.

  • tests/test_text_attr_coverage_r12.cpp L1-492

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 round 12 UT for tools/widgets/attribute panel coverage test: add UT for tools/widgets/attribute panel coverage Dec 1, 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 5b4b73d into linuxdeepin:master Dec 1, 2026
14 checks passed
@wyu71
wyu71 deleted the agent/ut-bot/fa67fdce5eac branch December 1, 2026 06:02
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