Skip to content

Expand test coverage with 1300+ lines of new tests#165

Merged
fernandotonon merged 2 commits intomasterfrom
chore/increase-test-coverage-80
Mar 2, 2026
Merged

Expand test coverage with 1300+ lines of new tests#165
fernandotonon merged 2 commits intomasterfrom
chore/increase-test-coverage-80

Conversation

@fernandotonon
Copy link
Owner

Summary

  • Add 5 new test files: AnimationMerger_test.cpp, EditorViewport_test.cpp, MCPSettingsDialog_test.cpp, animationcontrolwidget_test.cpp, material_test.cpp
  • Expand 6 existing test files with additional test cases: Manager_test.cpp, MaterialEditorQML_test.cpp, SkeletonDebug_test.cpp, SpaceCamera_test.cpp, TransformOperator_test.cpp, mainwindow_test.cpp
  • Total: ~1,331 new lines of test code covering signals, selections, transforms, UI validation, and edge cases

New test coverage areas

  • AnimationMerger: skeleton compatibility checks, merge operations, error handling
  • EditorViewport: construction, index retrieval, OgreWidget access, close signal
  • MCPSettingsDialog: UI elements, default values, port spinbox state, callbacks
  • AnimationControlWidget: construction, animation tree updates with/without selection
  • Material widget: construction, UI elements, material list population
  • Manager (expanded): scene node get/destroy by pointer, signals (created/destroyed), Ogre root/SceneMgr access
  • MaterialEditorQML (expanded): texture unit signals, color no-change tests, multi-pass operations, apply/open material editor
  • TransformOperator (expanded): position/scale/rotation with selection, remove with selection, signals (position/orientation/deleted), state cycling
  • SpaceCamera (expanded): keyboard input (WASD), shift modifier, mouse button press/release/move
  • SkeletonDebug (expanded): update method, scale edge cases, toggle combinations, show/hide all
  • mainwindow (expanded): setPlaying, setMCPServer, importMeshs with invalid/empty lists

Test plan

  • CI builds successfully on all platforms
  • All test suites pass (no new failures)
  • SonarCloud coverage increases toward 80%+ target

🤖 Generated with Claude Code

Add 5 new test files (AnimationMerger, EditorViewport, MCPSettingsDialog,
AnimationControlWidget, Material widget) and expand 6 existing test files
(Manager, MaterialEditorQML, SkeletonDebug, SpaceCamera, TransformOperator,
mainwindow) with additional test cases for signals, selections, transforms,
and UI validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 993b010006

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

spaceCamera.setCameraSpeed(0.5f);
QKeyEvent pressEvent(QEvent::KeyPress, Qt::Key_Shift, Qt::ShiftModifier);
spaceCamera.keyPressEvent(&pressEvent);
EXPECT_GT(spaceCamera.getCameraSpeed(), 0.5f);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align speed-modifier test with actual key binding

This expectation assumes pressing Shift changes camera speed, but SpaceCamera::keyPressEvent only adjusts speed for Qt::Key_Control and has no Shift branch (src/SpaceCamera.cpp), so the value remains 0.5f and this test fails deterministically; the same incorrect assumption also causes KeyReleaseShiftModifier to fail. Keeping this assertion breaks the test suite even when runtime behavior is correct.

Useful? React with 👍 / 👎.

The speed modifier in SpaceCamera is bound to Control (not Shift).
Updated tests to press Control and verify the exact speed values
(0.01 on press, 0.1 on release) instead of relying on relative
comparisons against the mock's default speed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@fernandotonon fernandotonon merged commit d2e8243 into master Mar 2, 2026
14 checks passed
@fernandotonon fernandotonon deleted the chore/increase-test-coverage-80 branch March 2, 2026 13:25
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.

1 participant