test: add unit tests for IDrawTool - #231
Merged
Merged
Conversation
Reviewer's GuideAdds 18 Google Test cases covering IDrawTool start, update, finish, cursor, and double-click paths, plus a CMake option and compile definition to enable the suite. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…inish, getCursor, dueTouchDoubleClickedStart Add 18 Google Test cases for IDrawTool in idrawtool.cpp. 为idrawtool.cpp中IDrawTool类补充18个Google Test单元测试用例。 Log: 补充IDrawTool类5个方法单元测试 Influence: 提升IDrawTool类测试覆盖率
wyu71
force-pushed
the
agent/agent/173eb72f4c00
branch
from
September 16, 2026 00:55
f7fa2ad to
9311f04
Compare
lzwind
approved these changes
Sep 16, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, wyu71 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 18 Google Test unit test cases for
IDrawToolclass inidrawtool.cpp, covering 5 methods:toolDoStart(4 cases): simulated event with no button, mouse left button, touch event, max touch points exceededtoolDoUpdate(4 cases): empty records, EDoNotthing, EDoQtCoversion, ENormal with no movementtoolDoFinish(4 cases): empty records, EDoNotthing, EDoQtCoversion, ENormalgetCursor(4 cases): all directions without mouse press, rotation/inrect/none directions, with mouse left press, different tool typesdueTouchDoubleClickedStart(4 cases): simulated event, touch first call, touch double-click, mouse double-clickBuild & Test Results
Changes
tests/testItems/test_idrawtool.cpp: New test file with 18 GTest casestests/CMakeLists.txt: AddDEEPINDRAW_TEST_IDRAWTOOL_ITEMCMake optionSummary by Sourcery
Add unit test coverage for IDrawTool’s input-event and cursor behavior.
Build:
Tests: