Skip to content

Conversation

@Kryptos-FR
Copy link
Member

@Kryptos-FR Kryptos-FR commented Nov 11, 2025

PR Details

Improve the code coverage of Stride.Core.CompilerServices, Stride.Core.Design and Stride.Core.Mathematics.

Details

Tests were written with the help of GitHub Copilot. It also helped detect some issue in Core.Mathematics.

One is already tracked #2672. Fixing it would potentially be a breaking change, so it wasn't done in this PR.

Another was that Plane.Negate(Plane) wasn't negating the plane, but instead normalizing it, likely because of an unfortunate copy/paste. I decided to fix it since it was never correct before.

HybridDictionary also has a few issues, like throwing when initializing with a zero capacity (which should be allowed).

Overall, we now have a very good coverage for Mathematics and CompilerServices, and a passable coverage for Design:

Assembly Line coverage Branch coverage
Stride.Core.CompilerServices 85.6% 74.1%
Stride.Core.Design 55.8% 56.4%
Stride.Core.Mathematics 81.3% 61.5%

Before that PR, the coverage was:

Assembly Line coverage Branch coverage
Stride.Core.CompilerServices 84.7% 73.2%
Stride.Core.Design 36.8% 33.5%
Stride.Core.Mathematics 16.8% 7.9%

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Kryptos-FR Kryptos-FR added enhancement New feature or request area-Core Issue of the engine unrelated to other defined areas area-Math Issues related to the Stride.Core.Mathematics namespace labels Nov 11, 2025
@Kryptos-FR Kryptos-FR force-pushed the feature/core-unit-tests branch from e56cbff to a20e685 Compare November 23, 2025 12:49
@Kryptos-FR Kryptos-FR marked this pull request as ready for review November 23, 2025 15:22
Generated with the help of GitHub Copilot & Claude Sonnet 4.5
The static Negate method was copy-pasted from the Normalize method and was performing normalization (making the normal vector unit length) instead of negation (flipping all coefficients).
Generated with the help of GitHub Copilot & Claude Sonnet 4.5
Generated with the help of GitHub Copilot & Claude Sonnet 4.5
@Kryptos-FR Kryptos-FR force-pushed the feature/core-unit-tests branch from a20e685 to e056066 Compare November 23, 2025 15:28
@Kryptos-FR Kryptos-FR changed the title WIP: Add unit tests in Core to increase coverage feat: Add unit tests in Core to increase coverage Nov 23, 2025
@xen2 xen2 merged commit 24ee4d4 into stride3d:master Dec 3, 2025
8 checks passed
@Kryptos-FR Kryptos-FR deleted the feature/core-unit-tests branch December 5, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Core Issue of the engine unrelated to other defined areas area-Math Issues related to the Stride.Core.Mathematics namespace bug-fix enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants