diff --git a/src/cpp/benders/benders_core/include/BendersBase.h b/src/cpp/benders/benders_core/include/BendersBase.h index 74adc3d6a..19b38c97c 100644 --- a/src/cpp/benders/benders_core/include/BendersBase.h +++ b/src/cpp/benders/benders_core/include/BendersBase.h @@ -159,7 +159,7 @@ class BendersBase { private: BendersBaseOptions _options; unsigned int _totalNbProblems = 0; - std::filesystem::path _log_name; + std::filesystem::path _log_name = ""; BendersRelevantIterationsData relevantIterationData_ = { std::make_shared(), nullptr}; WorkerMasterPtr _master; diff --git a/tests/cpp/benders/benders_sequential_test.cpp b/tests/cpp/benders/benders_sequential_test.cpp index 7e994dca7..acf7f2c29 100644 --- a/tests/cpp/benders/benders_sequential_test.cpp +++ b/tests/cpp/benders/benders_sequential_test.cpp @@ -78,7 +78,7 @@ class BendersSequentialDouble : public BendersSequential { void InitializeProblems() override { MatchProblemToId(); - auto solver_log_manager = std::make_shared(log_name()); + auto solver_log_manager = SolverLogManager(log_name()); reset_master(new WorkerMaster(master_variable_map, get_master_path(), get_solver_name(), get_log_level(), _data.nsubproblem, solver_log_manager, diff --git a/tests/cpp/lp_namer/MasterProblemBuilderTest.cpp b/tests/cpp/lp_namer/MasterProblemBuilderTest.cpp index bd25dc1e8..725181d15 100644 --- a/tests/cpp/lp_namer/MasterProblemBuilderTest.cpp +++ b/tests/cpp/lp_namer/MasterProblemBuilderTest.cpp @@ -32,7 +32,7 @@ TEST(MasterProblemBuilderTest, test_one_candidate_not_integer) { candidates.insert(candidates.end(), candidateFromLink.begin(), candidateFromLink.end()); } - auto solver_log_manager = std::make_shared(""); + auto solver_log_manager = SolverLogManager(""); auto master_problem = MasterProblemBuilder(master_formulation) .build(solver_name, candidates, solver_log_manager); ASSERT_EQ(master_problem->get_ncols(), 1); @@ -87,7 +87,7 @@ TEST(MasterProblemBuilderTest, test_one_candidate_integer_problem_integer) { candidateFromLink.end()); } - auto solver_log_manager = std::make_shared(""); + auto solver_log_manager = SolverLogManager(""); auto master_problem = MasterProblemBuilder(master_formulation) .build(solver_name, candidates, solver_log_manager); ASSERT_EQ(master_problem->get_ncols(), 2); @@ -150,7 +150,7 @@ TEST(MasterProblemBuilderTest, test_one_candidate_integer_problem_relaxed) { candidateFromLink.end()); } - auto solver_log_manager = std::make_shared(""); + auto solver_log_manager = SolverLogManager(""); auto master_problem = MasterProblemBuilder(master_formulation) .build(solver_name, candidates, solver_log_manager); ASSERT_EQ(master_problem->get_ncols(), 1); diff --git a/tests/cpp/sensitivity/SensitivityPbModifierTest.cpp b/tests/cpp/sensitivity/SensitivityPbModifierTest.cpp index b026dd55d..c1ff05934 100644 --- a/tests/cpp/sensitivity/SensitivityPbModifierTest.cpp +++ b/tests/cpp/sensitivity/SensitivityPbModifierTest.cpp @@ -55,8 +55,7 @@ class SensitivityProblemModifierTest : public ::testing::Test std::string solver_name = "CBC"; SolverFactory factory; - auto solver_log_manager = - std::make_shared(std::tmpnam(nullptr)); + auto solver_log_manager = SolverLogManager(std::tmpnam(nullptr)); SolverAbstract::Ptr solver_model = factory.create_solver(solver_name, solver_log_manager); solver_model->init(); diff --git a/tests/cpp/sensitivity/SensitivityStudyTest.cpp b/tests/cpp/sensitivity/SensitivityStudyTest.cpp index db1a4fcdc..6559f5b9b 100644 --- a/tests/cpp/sensitivity/SensitivityStudyTest.cpp +++ b/tests/cpp/sensitivity/SensitivityStudyTest.cpp @@ -38,8 +38,7 @@ class SensitivityStudyTest : public ::testing::Test { void init_solver(std::string solver_name, std::string last_master_mps_path) { SolverFactory factory; - auto solver_log_manager = - std::make_shared(std::tmpnam(nullptr)); + auto solver_log_manager = SolverLogManager(std::tmpnam(nullptr)); math_problem = factory.create_solver(solver_name, solver_log_manager); math_problem->init(); math_problem->read_prob_mps(last_master_mps_path);