Browse Source

docs: clarify SCENARIO grouping for shared setup/teardown in refactoring rules

test-refactor
cinnaboot 2 months ago
parent
commit
ed786b3217
  1. 14
      continue.md

14
continue.md

@ -4,7 +4,8 @@
### 1. Structure ### 1. Structure
- One `SCENARIO("description")` per logical test group, with `[tag1][tag2]` annotations - One `SCENARIO("description")` per logical test group, with `[tag1][tag2]` annotations
- Shared fixture: all constants, structs, and variables declared between `SCENARIO` opening and first `SECTION` - **Use SCENARIO to share setup/teardown across multiple SECTIONs.** Catch2 re-initializes the fixture before each SECTION, so declare shared constants, structs, and variables in the SCENARIO body (between the opening `{` and the first `SECTION`). These persist across all SECTIONs within the SCENARIO.
- Example: a `SimulationState* sim` created once in the SCENARIO body, then each SECTION mutates and tests it independently.
- Embed expected values directly in `WithinAbs()` calls (see Section 4 for precalc script usage). No need to declare named constants unless the value is reused. - Embed expected values directly in `WithinAbs()` calls (see Section 4 for precalc script usage). No need to declare named constants unless the value is reused.
### 2. Duplication Elimination ### 2. Duplication Elimination
@ -121,12 +122,21 @@ All constants defined in `src/test_utilities.h` — use those, do not redefine l
- `test_extreme_orientation_mixed` ✅ — Extreme orientation conversions, rotation matrix properties, singularity handling - `test_extreme_orientation_mixed` ✅ — Extreme orientation conversions, rotation matrix properties, singularity handling
- `test_extreme_timescales` ✅ — 9 TEST_CASEs → 1 SCENARIO with 11 SECTIONs, all WithinAbs use named constants - `test_extreme_timescales` ✅ — 9 TEST_CASEs → 1 SCENARIO with 11 SECTIONs, all WithinAbs use named constants
- `test_analytical_propagation` ✅ — 5 SCENARIOs → 1 SCENARIO with 23 SECTIONs, precalculated values, all WithinAbs use named constants - `test_analytical_propagation` ✅ — 5 SCENARIOs → 1 SCENARIO with 23 SECTIONs, precalculated values, all WithinAbs use named constants
- `test_moon_orbits` ✅ — Multi-body hierarchical propagation with local/global coordinate tracking
- `test_energy` ✅ — Energy calculations and conservation tests
- `test_inclined_orbits` ✅ — 3D inclined orbit conversions, Molniya orbits, rotation matrices
- `test_maneuvers` ✅ — Impulsive burn tests with precalculated values
- `test_orbital_period` ✅ — Orbital period calculations, SCENARIO/SECTION pattern
- `test_true_anomaly_roundtrip` ✅ — True anomaly conversion round-trips, tight tolerances
### Can Refactor Now (sim_engine.py supports all features needed) ### Can Refactor Now (sim_engine.py supports all features needed)
- `test_moon_orbits` — multi-body propagation
- `test_periapsis_burn` — prograde burns - `test_periapsis_burn` — prograde burns
- `test_hybrid_burns` — impulse burns - `test_hybrid_burns` — impulse burns
- `test_omega_debug` — burn + element reconstruction - `test_omega_debug` — burn + element reconstruction
- `test_orbit_rendering` — rendering tests (check if sim_engine needed)
- `test_precision_boundaries` — boundary condition tests
- `test_invalid_parent_assignment` — validation/error handling tests
- `test_newton_raphson_convergence` — numerical convergence tests
### Blocked on Missing Features ### Blocked on Missing Features
- `test_soi_transition` — needs SOI transitions - `test_soi_transition` — needs SOI transitions

Loading…
Cancel
Save