Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ Add additional unit tests for types.h #26994

Merged

Conversation

sjasonsmith
Copy link
Contributor

@sjasonsmith sjasonsmith commented Apr 21, 2024

Description

  • Add several new unit tests for XYval, XYZval, and XYZEval.
    • These worked as expected, with one exception marked as BUG? which requires further understanding. It is unclear whether small and large are intender do perform direct numeric comparisons (as they do now), or if they should return results based on how far they are from zero (absolute value).
  • Add tests for various sizes of Flags structs.
    • This identified a major flaw in the implementation, because only 8 bits are used for store even if 32 flags are requested.
    • For now passing tests are submitted, with comments where they are testing for the incorrect result.
    • Fixing the behavior and tests will come in a later PR. This allows the steps of adding tests and fixing bugs to be clearly separated, to avoid testing for behavior which is changing as tests are being written.

@sjasonsmith sjasonsmith merged commit 556da2b into MarlinFirmware:bugfix-2.1.x Apr 21, 2024
1 check passed
@sjasonsmith sjasonsmith deleted the PR/unit_tests_flags branch April 21, 2024 16:43
mikezs added a commit to mikezs/Marlin that referenced this pull request Apr 26, 2024
* bugfix-2.1.x: (111 commits)
  [cron] Bump distribution date (2024-04-25)
  🩹 IA-Creality minor cleanup
  🩹 Simple IA-Creality babystep patch
  🚸 Fix duplicate temperature report (MarlinFirmware#26952)
  [cron] Bump distribution date (2024-04-24)
  ✏️ MPCTEMP_START => MPC_STARTED (MarlinFirmware#27002)
  🔧 BIQU MicroProbe V2 pull-up warning (MarlinFirmware#27008)
  🎨 Format pins which fail validation (MarlinFirmware#27007)
  ✅  CI - Validate Pins Formatting (MarlinFirmware#26996)
  [cron] Bump distribution date (2024-04-23)
  🎨 Clean up after recent PRs
  [cron] Bump distribution date (2024-04-22)
  🐛 Fix Flags<N> data storage width (MarlinFirmware#26995)
  ✅ Add additional unit tests for types.h (MarlinFirmware#26994)
  ✅ Unit test improvements (MarlinFirmware#26993)
  🔧 Add RAMPS TMC SPI pins when !TMC_USE_SW_SPI (MarlinFirmware#26960)
  🐛 Fix PID upon entering PID_FUNCTIONAL_RANGE (MarlinFirmware#26926)
  [cron] Bump distribution date (2024-04-21)
  🎨Match unit test folder structure to code (MarlinFirmware#26990)
  ✅ Skip compile tests when editing unit tests (MarlinFirmware#26991)
  ...
RPGFabi pushed a commit to RPGFabi/Marlin that referenced this pull request Jun 15, 2024
* Add more XYval (and similar) unit tests

* Add  Flags tests, with multiple BUGs identified
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