Browse Source

refactor: rename rendezvous_hohmann to rendezvous

Rename src/rendezvous_hohmann.{h,cpp} to src/rendezvous.{h,cpp} and
tests/test_rendezvous_hohmann.{cpp,toml} to tests/test_rendezvous.{cpp,toml}.

This consolidates the rendezvous module under a simpler name since the
old CW-based rendezvous module was removed and only Hohmann transfer
functionality remains.

Update all includes, config paths, and Makefile references.
main
cinnaboot 3 months ago
parent
commit
a653749a04
  1. 2
      Makefile
  2. 2
      src/rendezvous.cpp
  3. 4
      src/rendezvous.h
  4. 18
      tests/test_rendezvous.cpp
  5. 0
      tests/test_rendezvous.toml

2
Makefile

@ -81,7 +81,7 @@ test-build: $(BUILD_DIR) $(C_OBJECTS) $(CPP_OBJECTS) $(TEST_OBJECTS)
build/config_loader.o \
build/config_validator.o \
build/maneuver.o \
build/rendezvous_hohmann.o \
build/rendezvous.o \
-o $(TEST_TARGET) -lCatch2Main -lCatch2 -lm
# Run automated test suite

2
src/rendezvous_hohmann.cpp → src/rendezvous.cpp

@ -1,4 +1,4 @@
#include "rendezvous_hohmann.h"
#include "rendezvous.h"
#include <math.h>
#include <float.h>

4
src/rendezvous_hohmann.h → src/rendezvous.h

@ -1,5 +1,5 @@
#ifndef RENDEZVOUS_HOHMANN_H
#define RENDEZVOUS_HOHMANN_H
#ifndef RENDEZVOUS_H
#define RENDEZVOUS_H
#include "orbital_mechanics.h"
#include "simulation.h"

18
tests/test_rendezvous_hohmann.cpp → tests/test_rendezvous.cpp

@ -4,7 +4,7 @@
#include "../src/orbital_mechanics.h"
#include "../src/simulation.h"
#include "../src/orbital_objects.h"
#include "../src/rendezvous_hohmann.h"
#include "../src/rendezvous.h"
#include "../src/config_loader.h"
#include "../src/test_utilities.h"
#include <cmath>
@ -33,7 +33,7 @@ TEST_CASE("Config loading for Hohmann transfer", "[rendezvous_hohmann][config]")
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
REQUIRE(sim->body_count == 1);
REQUIRE(std::string(sim->bodies[0].name) == "Earth");
@ -63,7 +63,7 @@ TEST_CASE("Calculate wait time for Hohmann transfer (lower to higher)", "[rendez
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
int target_idx = find_spacecraft_by_name(sim, "Target_Satellite");
int chaser_lower_idx = find_spacecraft_by_name(sim, "Chaser_Lower");
@ -118,7 +118,7 @@ TEST_CASE("Calculate wait time for Hohmann transfer (higher to lower)", "[rendez
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
int target_idx = find_spacecraft_by_name(sim, "Target_Satellite");
int chaser_higher_idx = find_spacecraft_by_name(sim, "Chaser_Higher");
@ -162,7 +162,7 @@ TEST_CASE("Calculate required separation for Hohmann transfer", "[rendezvous_hoh
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
int target_idx = find_spacecraft_by_name(sim, "Target_Satellite");
int chaser_lower_idx = find_spacecraft_by_name(sim, "Chaser_Lower");
@ -220,7 +220,7 @@ TEST_CASE("Validate Hohmann transfer parameters", "[rendezvous_hohmann][validati
const double TIME_STEP = 30.0;
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
initialize_orbital_objects(sim);
Spacecraft* chaser_lower = &sim->spacecraft[1];
@ -281,7 +281,7 @@ TEST_CASE("Calculate relative orbit period", "[rendezvous_hohmann][phasing]") {
const double TIME_STEP = 30.0;
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
initialize_orbital_objects(sim);
Spacecraft* chaser_lower = &sim->spacecraft[1];
@ -344,7 +344,7 @@ TEST_CASE("Calculate next valid wait time for Hohmann transfer", "[rendezvous_ho
const double TIME_STEP = 30.0;
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
initialize_orbital_objects(sim);
Spacecraft* chaser_lower = &sim->spacecraft[1];
@ -434,7 +434,7 @@ SCENARIO("Hohmann transfer rendezvous with validation", "[rendezvous_hohmann][in
const double TIME_STEP = 0.1;
SimulationState* sim = create_simulation(3, 5, 10, TIME_STEP);
REQUIRE(load_system_config(sim, "tests/test_rendezvous_hohmann.toml"));
REQUIRE(load_system_config(sim, "tests/test_rendezvous.toml"));
int target_idx = find_spacecraft_by_name(sim, "Target_Satellite");
int chaser_lower_idx = find_spacecraft_by_name(sim, "Chaser_Lower");

0
tests/test_rendezvous_hohmann.toml → tests/test_rendezvous.toml

Loading…
Cancel
Save