Skip to content

Commit

Permalink
Remove get()
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 31, 2024
1 parent 8d19736 commit 04b5f05
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/tests/src/api_internal/test_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(api_run_contains_antares_problem)
{
Antares::API::APIInternal api;
auto study_loader = std::make_unique<InMemoryStudyLoader>();
auto results = api.run(*study_loader.get(), {}, {});
auto results = api.run(*study_loader, {}, {});

BOOST_CHECK(!results.antares_problems.empty());
BOOST_CHECK(!results.error);
Expand All @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(result_failure_when_study_is_null)
{
Antares::API::APIInternal api;
auto study_loader = std::make_unique<InMemoryStudyLoader>(false);
auto results = api.run(*study_loader.get(), {}, {});
auto results = api.run(*study_loader, {}, {});

BOOST_CHECK(results.error);
}
Expand All @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(result_contains_problems)
{
Antares::API::APIInternal api;
auto study_loader = std::make_unique<InMemoryStudyLoader>();
auto results = api.run(*study_loader.get(), {}, {});
auto results = api.run(*study_loader, {}, {});

BOOST_CHECK(!results.antares_problems.empty());
BOOST_CHECK(!results.error);
Expand All @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(result_with_ortools_coin)
.solverLogs = false,
.solverParameters = ""};

auto results = api.run(*study_loader.get(), {}, opt);
auto results = api.run(*study_loader, {}, opt);

BOOST_CHECK(!results.antares_problems.empty());
BOOST_CHECK(!results.error);
Expand All @@ -115,8 +115,7 @@ BOOST_AUTO_TEST_CASE(invalid_ortools_solver)
.solverLogs = true,
.solverParameters = ""};

auto shouldThrow = [&api, &study_loader, &opt]
{ return api.run(*study_loader.get(), {}, opt); };
auto shouldThrow = [&api, &study_loader, &opt] { return api.run(*study_loader, {}, opt); };
BOOST_CHECK_EXCEPTION(shouldThrow(),
std::invalid_argument,
checkMessage("Solver this-solver-does-not-exist not found"));
Expand Down

0 comments on commit 04b5f05

Please sign in to comment.