Browse Source

Remove redundant burn1_expected_v assertion, tighten SMA precision

- Remove burn1_expected_v constant and its assertion (line 72) — burn_result
  velocity on line 66 already provides a tighter check with V_TOL
- Update burn1_expected_sma to full precision (15 decimal places)
- Remove unused v_before variable
- Net: 822 assertions (removed 1 redundant, kept burn_result-based checks)
test-refactor
cinnaboot 2 months ago
parent
commit
b2401305ea
  1. 8
      tests/test_periapsis_burn.cpp

8
tests/test_periapsis_burn.cpp

@ -24,8 +24,7 @@ SCENARIO("Periapsis-triggered prograde burn behavior", "[maneuver][periapsis]")
// Shared fixture values (from precalc_periapsis_burn.py)
const double initial_periapsis = 7259700.0;
const double burn1_preburn_v = 8448.412303782408344;
const double burn1_expected_sma = 13404876.6810;
const double burn1_expected_v = 8943.1448;
const double burn1_expected_sma = 13404876.681005753576756;
// BurnResult captures exact pre-burn state vectors, enabling tight
// tolerances (R_TOL, ANG_TOL) for periapsis assertions.
@ -41,7 +40,6 @@ SCENARIO("Periapsis-triggered prograde burn behavior", "[maneuver][periapsis]")
}
SECTION("prograde burn at periapsis fires immediately and raises orbit") {
double v_before = vec3_magnitude(craft->local_velocity);
double a_before = craft->orbit.semi_major_axis;
double e_before = craft->orbit.eccentricity;
double peri_before = a_before * (1.0 - e_before);
@ -67,15 +65,13 @@ SCENARIO("Periapsis-triggered prograde burn behavior", "[maneuver][periapsis]")
// Pre-burn velocity captured at exact burn time (tight tolerance)
REQUIRE_THAT(vec3_magnitude(br.velocity), WithinAbs(burn1_preburn_v, V_TOL));
// Semi-major axis and velocity after burn + 60s propagation (propagation-level tolerance)
// Semi-major axis after burn + 60s propagation (propagation-level tolerance)
REQUIRE_THAT(final_sma, WithinAbs(burn1_expected_sma, A_TOL * 10));
REQUIRE_THAT(vec3_magnitude(craft->local_velocity), WithinAbs(burn1_expected_v, V_TOL * 100));
INFO("Initial SMA: " << a_before << " m");
INFO("Final SMA: " << final_sma << " m");
INFO("Initial periapsis: " << peri_before << " m");
INFO("Final periapsis: " << final_periapsis << " m");
INFO("Velocity change: " << (v_before - vec3_magnitude(craft->local_velocity)) << " m/s");
INFO("Burn time position: " << br.position.x << ", " << br.position.y << ", " << br.position.z);
INFO("Burn time velocity: " << br.velocity.x << ", " << br.velocity.y << ", " << br.velocity.z);
}

Loading…
Cancel
Save