From 84871587a08a8f2436a0cfd4b959cb239db0d89e Mon Sep 17 00:00:00 2001 From: pleroy Date: Wed, 25 Oct 2023 21:52:10 +0200 Subject: [PATCH] The copy constructor is a plague. --- journal/player_test.cpp | 13 ++++++++----- ksp_plugin/flight_plan.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/journal/player_test.cpp b/journal/player_test.cpp index 5163a51acd..35cddf72b9 100644 --- a/journal/player_test.cpp +++ b/journal/player_test.cpp @@ -113,7 +113,7 @@ TEST_F(PlayerTest, DISABLED_SECULAR_Scan) { // |method_out_return| protocol buffers. TEST_F(PlayerTest, DISABLED_SECULAR_Debug) { std::string path = - R"(P:\Public Mockingbird\Principia\Journals\JOURNAL.20230506-192603)"; // NOLINT + R"(P:\Public Mockingbird\Principia\Issues\3782\JOURNAL.20231025-212010)"; // NOLINT Player player(path); int count = 0; while (player.Play(count)) { @@ -135,17 +135,20 @@ TEST_F(PlayerTest, DISABLED_SECULAR_Debug) { serialization::Method method_in; { auto* extension = method_in.MutableExtension( - serialization::DeletePlugin::extension); + serialization::FlightPlanGetCoastAnalysis::extension); auto* in = extension->mutable_in(); - in->set_plugin(2734566559920); + in->set_plugin(1813489403728); + in->set_vessel_guid("5f7e35b7-645a-4985-9734-7bdeb31b2336"); + in->set_ground_track_revolution(0); + in->set_index(0); } serialization::Method method_out_return; { auto* extension = method_out_return.MutableExtension( - serialization::DeletePlugin::extension); + serialization::FlightPlanGetCoastAnalysis::extension); } LOG(ERROR) << "Running unpaired method:\n" << method_in.DebugString(); - CHECK(RunIfAppropriate( + CHECK(RunIfAppropriate( method_in, method_out_return, player)); #endif #if 0 diff --git a/ksp_plugin/flight_plan.cpp b/ksp_plugin/flight_plan.cpp index 49a9719f63..7eaa43cace 100644 --- a/ksp_plugin/flight_plan.cpp +++ b/ksp_plugin/flight_plan.cpp @@ -101,7 +101,7 @@ FlightPlan::FlightPlan(FlightPlan const& other) ++it) { segments_.push_back(it); } - for (int i = 0; i < coast_analysers_.size(); ++i) { + for (int i = 0; i < other.coast_analysers_.size(); ++i) { coast_analysers_.push_back(make_not_null_unique( ephemeris_, DefaultHistoryParameters())); }