Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e85b90285a5a
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 858ab5dc8c6c
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on May 27, 2019

  1. Fix problems found on Linux.

    pleroy committed May 27, 2019
    Copy the full SHA
    1aee080 View commit details

Commits on May 28, 2019

  1. Copy the full SHA
    da59828 View commit details

Commits on May 29, 2019

  1. Merge pull request #2183 from pleroy/Linux

    Fix problems found on Linux
    pleroy authored May 29, 2019
    Copy the full SHA
    858ab5d View commit details
Showing with 58 additions and 51 deletions.
  1. +4 −2 Makefile
  2. +54 −49 ksp_plugin_test/interface_flight_plan_test.cpp
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ ASTRONOMY_LIB_TRANSLATION_UNITS := $(filter-out $(TEST_OR_FAKE_OR_MOCK_TR
BASE_LIB_TRANSLATION_UNITS := $(filter-out $(TEST_OR_FAKE_OR_MOCK_TRANSLATION_UNITS), $(wildcard base/*.cpp))
JOURNAL_LIB_TRANSLATION_UNITS := $(filter-out $(TEST_OR_FAKE_OR_MOCK_TRANSLATION_UNITS), $(wildcard journal/*.cpp))
NUMERICS_LIB_TRANSLATION_UNITS := $(filter-out $(TEST_OR_FAKE_OR_MOCK_TRANSLATION_UNITS), $(wildcard numerics/*.cpp))
PHYSICS_LIB_TRANSLATION_UNITS := $(filter-out $(TEST_OR_FAKE_OR_MOCK_TRANSLATION_UNITS), $(wildcard physics/*.cpp))
PROTO_FILES := $(wildcard */*.proto)
PROTO_TRANSLATION_UNITS := $(PROTO_FILES:.proto=.pb.cc)
PROTO_HEADERS := $(PROTO_FILES:.proto=.pb.h)
@@ -172,6 +173,7 @@ ASTRONOMY_LIB_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(ASTRONOMY_LIB_TR
BASE_LIB_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(BASE_LIB_TRANSLATION_UNITS:.cpp=.o)) $(VERSION_OBJECTS)
JOURNAL_LIB_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(JOURNAL_LIB_TRANSLATION_UNITS:.cpp=.o))
NUMERICS_LIB_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(NUMERICS_LIB_TRANSLATION_UNITS:.cpp=.o)) $(VERSION_OBJECTS)
PHYSICS_LIB_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(PHYSICS_LIB_TRANSLATION_UNITS:.cpp=.o))
TEST_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(TEST_TRANSLATION_UNITS:.cpp=.o))
FAKE_OR_MOCK_OBJECTS := $(addprefix $(OBJ_DIRECTORY), $(FAKE_OR_MOCK_TRANSLATION_UNITS:.cpp=.o))

@@ -211,7 +213,7 @@ $(TOOLS_BIN): $(TOOLS_OBJECTS) $(PROTO_OBJECTS) $(NUMERICS_LIB_OBJECTS)

KSP_PLUGIN := $(PLUGIN_DIRECTORY)principia.so

$(KSP_PLUGIN) : $(PROTO_OBJECTS) $(PLUGIN_OBJECTS) $(JOURNAL_LIB_OBJECTS) $(BASE_LIB_OBJECTS) $(NUMERICS_LIB_OBJECTS)
$(KSP_PLUGIN) : $(PROTO_OBJECTS) $(PLUGIN_OBJECTS) $(JOURNAL_LIB_OBJECTS) $(BASE_LIB_OBJECTS) $(NUMERICS_LIB_OBJECTS) $(PHYSICS_LIB_OBJECTS)
@mkdir -p $(@D)
$(CXX) $(SHAREDFLAG) $(LDFLAGS) $^ $(LIBS) -o $@

@@ -266,7 +268,7 @@ PACKAGE_BENCHMARK_TARGET := $(patsubst $(BIN_DIRECTORY)%, %, $(PACKAGE_BENCHMARK

PRINCIPIA_BENCHMARK_BIN := $(BIN_DIRECTORY)benchmark

$(PRINCIPIA_BENCHMARK_BIN) : $(BENCHMARK_OBJECTS) $(FAKE_OR_MOCK_OBJECTS) $(GMOCK_OBJECTS) $(KSP_PLUGIN) $(BASE_LIB_OBJECTS) $(NUMERICS_LIB_OBJECTS)
$(PRINCIPIA_BENCHMARK_BIN) : $(BENCHMARK_OBJECTS) $(FAKE_OR_MOCK_OBJECTS) $(GMOCK_OBJECTS) $(KSP_PLUGIN) $(BASE_LIB_OBJECTS) $(NUMERICS_LIB_OBJECTS) $(PHYSICS_LIB_OBJECTS)
@mkdir -p $(@D)
$(CXX) $(LDFLAGS) $^ $(TEST_LIBS) -lpthread -o $@

103 changes: 54 additions & 49 deletions ksp_plugin_test/interface_flight_plan_test.cpp
Original file line number Diff line number Diff line change
@@ -165,24 +165,26 @@ TEST_F(InterfaceFlightPlanTest, FlightPlan) {
EXPECT_EQ(4, principia__FlightPlanGetDesiredFinalTime(plugin_.get(),
vessel_guid));

EXPECT_CALL(flight_plan, adaptive_step_parameters())
.WillOnce(
ReturnRef(Ephemeris<Barycentric>::AdaptiveStepParameters(
EmbeddedExplicitRungeKuttaNyströmIntegrator<
DormandالمكاوىPrince1986RKN434FM,
Position<Barycentric>>(),
/*max_steps=*/1,
/*length_integration_tolerance=*/1 * Milli(Metre),
/*speed_integration_tolerance=*/1 * Milli(Metre) / Second)));
EXPECT_CALL(flight_plan, generalized_adaptive_step_parameters())
.WillOnce(
ReturnRef(Ephemeris<Barycentric>::GeneralizedAdaptiveStepParameters(
EmbeddedExplicitGeneralizedRungeKuttaNyströmIntegrator<
Fine1987RKNG34,
Position<Barycentric>>(),
/*max_steps=*/1,
/*length_integration_tolerance=*/1 * Milli(Metre),
/*speed_integration_tolerance=*/1 * Milli(Metre) / Second)));
{
Ephemeris<Barycentric>::AdaptiveStepParameters adaptive_step_parameters(
EmbeddedExplicitRungeKuttaNyströmIntegrator<
DormandالمكاوىPrince1986RKN434FM,
Position<Barycentric>>(),
/*max_steps=*/1,
/*length_integration_tolerance=*/1 * Milli(Metre),
/*speed_integration_tolerance=*/1 * Milli(Metre) / Second);
EXPECT_CALL(flight_plan, adaptive_step_parameters())
.WillOnce(ReturnRef(adaptive_step_parameters));
Ephemeris<Barycentric>::GeneralizedAdaptiveStepParameters
generalized_adaptive_step_parameters(
EmbeddedExplicitGeneralizedRungeKuttaNyströmIntegrator<
Fine1987RKNG34,
Position<Barycentric>>(),
/*max_steps=*/1,
/*length_integration_tolerance=*/1 * Milli(Metre),
/*speed_integration_tolerance=*/1 * Milli(Metre) / Second);
EXPECT_CALL(flight_plan, generalized_adaptive_step_parameters())
.WillOnce(ReturnRef(generalized_adaptive_step_parameters));
EXPECT_CALL(
flight_plan,
SetAdaptiveStepParameters(
@@ -215,35 +217,38 @@ TEST_F(InterfaceFlightPlanTest, FlightPlan) {
/*max_step=*/11,
/*length_integration_tolerance=*/22,
/*speed_integration_tolerance=*/33}));

Ephemeris<Barycentric>::AdaptiveStepParameters adaptive_step_parameters(
EmbeddedExplicitRungeKuttaNyströmIntegrator<
DormandالمكاوىPrince1986RKN434FM,
Position<Barycentric>>(),
/*max_steps=*/111,
/*length_integration_tolerance=*/222 * Metre,
/*speed_integration_tolerance=*/333 * Metre / Second);
EXPECT_CALL(flight_plan, adaptive_step_parameters())
.WillOnce(ReturnRef(adaptive_step_parameters));
Ephemeris<Barycentric>::GeneralizedAdaptiveStepParameters
generalized_adaptive_step_parameters(
EmbeddedExplicitGeneralizedRungeKuttaNyströmIntegrator<
Fine1987RKNG34,
Position<Barycentric>>(),
/*max_steps=*/111,
/*length_integration_tolerance=*/222 * Metre,
/*speed_integration_tolerance=*/333 * Metre / Second);
EXPECT_CALL(flight_plan, generalized_adaptive_step_parameters())
.WillOnce(ReturnRef(generalized_adaptive_step_parameters));
FlightPlanAdaptiveStepParameters expected_adaptive_step_parameters = {
/*integrator_kind=*/1,
/*generalized_integrator_kind=*/2,
/*max_step=*/111,
/*length_integration_tolerance=*/222,
/*speed_integration_tolerance=*/333};
EXPECT_EQ(expected_adaptive_step_parameters,
principia__FlightPlanGetAdaptiveStepParameters(
plugin_.get(), vessel_guid));
}

{
Ephemeris<Barycentric>::AdaptiveStepParameters adaptive_step_parameters(
EmbeddedExplicitRungeKuttaNyströmIntegrator<
DormandالمكاوىPrince1986RKN434FM,
Position<Barycentric>>(),
/*max_steps=*/111,
/*length_integration_tolerance=*/222 * Metre,
/*speed_integration_tolerance=*/333 * Metre / Second);
EXPECT_CALL(flight_plan, adaptive_step_parameters())
.WillOnce(ReturnRef(adaptive_step_parameters));
Ephemeris<Barycentric>::GeneralizedAdaptiveStepParameters
generalized_adaptive_step_parameters(
EmbeddedExplicitGeneralizedRungeKuttaNyströmIntegrator<
Fine1987RKNG34,
Position<Barycentric>>(),
/*max_steps=*/111,
/*length_integration_tolerance=*/222 * Metre,
/*speed_integration_tolerance=*/333 * Metre / Second);
EXPECT_CALL(flight_plan, generalized_adaptive_step_parameters())
.WillOnce(ReturnRef(generalized_adaptive_step_parameters));
FlightPlanAdaptiveStepParameters expected_adaptive_step_parameters = {
/*integrator_kind=*/1,
/*generalized_integrator_kind=*/2,
/*max_step=*/111,
/*length_integration_tolerance=*/222,
/*speed_integration_tolerance=*/333};
EXPECT_EQ(expected_adaptive_step_parameters,
principia__FlightPlanGetAdaptiveStepParameters(
plugin_.get(), vessel_guid));
}

EXPECT_CALL(*plugin_,
FillBodyCentredNonRotatingNavigationFrame(celestial_index, _))
@@ -397,9 +402,9 @@ TEST_F(InterfaceFlightPlanTest, FlightPlan) {
FillBodyCentredNonRotatingNavigationFrame(celestial_index, _))
.WillOnce(FillUniquePtr<1>(
new StrictMock<MockDynamicFrame<Barycentric, Navigation>>));
auto const manœuvre = NavigationManœuvre(/*initial_mass=*/1 * Kilogram, burn);
EXPECT_CALL(flight_plan, GetManœuvre(0))
.WillOnce(
ReturnRef(NavigationManœuvre(/*initial_mass=*/1 * Kilogram, burn)));
.WillOnce(ReturnRef(manœuvre));
EXPECT_CALL(flight_plan, number_of_manœuvres())
.WillOnce(Return(1));
EXPECT_CALL(flight_plan,