Skip to content

Commit

Permalink
refactor: adress MR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-cochran committed Oct 11, 2023
1 parent 75e08ca commit 6edc53a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/OpenSpaceToolkit/Astrodynamics/Trajectory/State.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class State
);

/// @brief Constructor. This constructor makes a new Coordinates Broker under the hood for every
/// State.
/// State. When possible, users should prefer passing in an existing Coordinates Broker or using a StateBuilder to
/// reduce memory footprint when constructing many states.
///
/// @param [in] anInstant An instant
/// @param [in] aCoordinates The coordinates at the instant in International System of Units
Expand Down
5 changes: 5 additions & 0 deletions test/OpenSpaceToolkit/Astrodynamics/Trajectory/State.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ TEST(OpenSpaceToolkit_Astrodynamics_Trajectory_State, Constructor)
CartesianPosition::Default(), CartesianVelocity::Default()
};
EXPECT_NO_THROW(State state(instant, coordinates, Frame::GCRF(), subsets));

const State state(instant, coordinates, Frame::GCRF(), subsets);

EXPECT_EQ(state.extractCoordinates(CartesianPosition::Default()), coordinates.segment(0, 3));
EXPECT_EQ(state.extractCoordinates(CartesianVelocity::Default()), coordinates.segment(3, 3));
}

{
Expand Down

0 comments on commit 6edc53a

Please sign in to comment.