From a03866dd57ed215aa9419813ba12bad1489388a3 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Mon, 16 Dec 2024 09:35:06 +0100 Subject: [PATCH] format --- src/solver/systemParser/converter.cpp | 18 +++++++++++------- .../solver/modelParser/testSystemConverter.cpp | 5 +++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/solver/systemParser/converter.cpp b/src/solver/systemParser/converter.cpp index 9886a4960a..14c7dca1df 100644 --- a/src/solver/systemParser/converter.cpp +++ b/src/solver/systemParser/converter.cpp @@ -19,9 +19,10 @@ * along with Antares_Simulator. If not, see . */ +#include "antares/solver/systemParser/converter.h" + #include -#include "antares/solver/systemParser/converter.h" #include "antares/solver/systemParser/system.h" #include "antares/study/system-model/system.h" @@ -35,8 +36,8 @@ static std::pair splitLibraryModelString(const std::st size_t pos = s.find('.'); if (pos == std::string::npos) { - throw std::runtime_error("Error while splitting library model: " + s + - "Correct format is lirabry.model"); + throw std::runtime_error("Error while splitting library model: " + s + + "Correct format is lirabry.model"); } std::string library = s.substr(0, pos); @@ -48,7 +49,8 @@ static const SystemModel::Model* getModel(const std::vector& libraries) +static SystemModel::Component createComponent(const SystemParser::Component& c, + const std::vector& libraries) { const auto [libraryId, modelId] = splitLibraryModelString(c.model); SystemModel::ModelBuilder model_builder; @@ -68,7 +71,7 @@ static SystemModel::Component createComponent(const SystemParser::Component& c, SystemModel::ComponentBuilder component_builder; std::map parameters; - for (const auto& p : c.parameters) + for (const auto& p: c.parameters) { parameters.try_emplace(p.id, p.value); } @@ -81,7 +84,8 @@ static SystemModel::Component createComponent(const SystemParser::Component& c, return component; } -SystemModel::System convert(const SystemParser::System& parserSystem, const std::vector& libraries) +SystemModel::System convert(const SystemParser::System& parserSystem, + const std::vector& libraries) { std::vector components; for (const auto& c: parserSystem.components) diff --git a/src/tests/src/solver/modelParser/testSystemConverter.cpp b/src/tests/src/solver/modelParser/testSystemConverter.cpp index 3e160d10f7..af4046a42e 100644 --- a/src/tests/src/solver/modelParser/testSystemConverter.cpp +++ b/src/tests/src/solver/modelParser/testSystemConverter.cpp @@ -25,9 +25,9 @@ #include #include -#include "antares/solver/modelParser/Library.h" -#include "antares/solver/modelConverter/modelConverter.h" #include +#include "antares/solver/modelConverter/modelConverter.h" +#include "antares/solver/modelParser/Library.h" #include "antares/study/system-model/library.h" using namespace std::string_literals; @@ -48,6 +48,7 @@ struct Fixture SystemParser::Parser parser; ModelParser::Library library; SystemModel::Library lib; + Fixture() { library.id = "std";