Skip to content

test: add unit tests for lcov coverage gaps - #306

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

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

Conversation

@wyu71

@wyu71 wyu71 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Add tests/test_coverage_r14.cpp covering remaining lcov gaps:

  • idrawtool.cpp:382-383 (toolDoUpdate doDecide==false)
  • cselecttool.cpp:340-342 (toolFinish picture item attributes)
  • cattributeitemwidget.cpp:266-270 (paintFillBorder alpha==0)
  • colorpanel.cpp:256-258, 277-278 (previewedColorChanged + alphaChanged)
  • idrawtool.cpp:577-578, 188-189, 550-551 + cdrawscene.cpp:335 (edit mode double-click paths)
  • cgraphicspenitem.cpp:490-509 (updateHandlesGeometry all directions)
  • cgraphicslineitem.cpp:279-306, 608 (Rotation handle + empty line)
  • cpictureitem.cpp:265 (getGraphicsUnit _srcByteArry copy)
  • cgraphicspolygonalstaritem.cpp:178, 188, 223 (cache reset paths)
  • cgraphicstextitem.cpp:458-459 (paint invalid rect)
  • cdrawtoolfactory.cpp:94-95, 151 (installTool nullptr + loadToolPlugin)
  • ctexttool.cpp:168-171, 184, 201-202 (restoreItemsFontFamily + isTextEnableUndo + toolCreatItemFinish)
  • cdrawscene.cpp:404, 455, 467-469 (group tree collection)

Issue: V-9958
Log: all tests pass (offscreen).

Summary by Sourcery

Expand unit-test coverage for remaining lcov gaps and improve isolation between tests.

Tests:

  • Add a new round-14 unit test suite that exercises additional drawing, selection, color, text-editing, graphics-item, tool-factory, and scene-grouping paths for lcov coverage.
  • Harden test isolation by disabling access to the D-Bus system bus and interrupting tools left working between tests.

@sourcery-ai

sourcery-ai Bot commented Dec 2, 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 11 hours and 15 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@wyu71
wyu71 force-pushed the agent/ut-bot/7a2dd3c7b6b7 branch from 789281a to 9301e7a Compare December 3, 2026 00:35
@wyu71 wyu71 changed the title test: add R14 unit tests for lcov coverage gaps test: add unit tests for lcov coverage gaps Dec 3, 2026
Add tests/test_coverage_r14.cpp covering remaining lcov gaps:
- idrawtool.cpp:382-383 (toolDoUpdate doDecide==false)
- cselecttool.cpp:340-342 (toolFinish picture item attributes)
- cattributeitemwidget.cpp:266-270 (paintFillBorder alpha==0)
- colorpanel.cpp:256-258, 277-278 (previewedColorChanged + alphaChanged)
- idrawtool.cpp:577-578, 188-189, 550-551 + cdrawscene.cpp:335 (edit mode double-click paths)
- cgraphicspenitem.cpp:490-509 (updateHandlesGeometry all directions)
- cgraphicslineitem.cpp:279-306, 608 (Rotation handle + empty line)
- cpictureitem.cpp:265 (getGraphicsUnit _srcByteArry copy)
- cgraphicspolygonalstaritem.cpp:178, 188, 223 (cache reset paths)
- cgraphicstextitem.cpp:458-459 (paint invalid rect)
- cdrawtoolfactory.cpp:94-95, 151 (installTool nullptr + loadToolPlugin)
- ctexttool.cpp:168-171, 184, 201-202 (restoreItemsFontFamily + isTextEnableUndo + toolCreatItemFinish)
- cdrawscene.cpp:404, 455, 467-469 (group tree collection)

Issue: V-9958
Log: all tests pass (offscreen).
@wyu71
wyu71 force-pushed the agent/ut-bot/7a2dd3c7b6b7 branch from 9301e7a to acbf248 Compare December 3, 2026 05:00
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Add coverage-gap tests that drive drawing tools, graphics items, widgets, and scene behavior, with the helper routines and related test setup in the same file.

  • tests/test_coverage_r14.cpp L1-656

Include the draw-tool interface needed by the test janitor and interrupt any tool left working so it cannot swallow shortcuts in later tests.

  • tests/test_qtestmain.cpp L23, L221-232

Isolate the system D-Bus during tests to prevent FileArmor prompts and keep file-access tests independent of host services.

  • tests/test_qtestmain.cpp L40-49

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

@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 90891ef into linuxdeepin:master Dec 3, 2026
2 checks passed
@wyu71
wyu71 deleted the agent/ut-bot/7a2dd3c7b6b7 branch December 3, 2026 06:21
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