Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 12, 2024
1 parent 533f0d5 commit 2e5a875
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/tests/src/solver/modelParser/testSystemParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,13 @@ BOOST_AUTO_TEST_CASE(parse_into_system_model)
SystemParser::System systemObj = parser.parse(system);

std::vector<SystemModel::Component> components;
for (const auto& c : systemObj.components)
for (const auto& c: systemObj.components)
{
components.push_back(createComponent(c));
}

SystemModel::SystemBuilder builder;
auto systemModel = builder.withId(systemObj.id)
.withComponents(components)
.build();
auto systemModel = builder.withId(systemObj.id).withComponents(components).build();

BOOST_CHECK_EQUAL(systemModel.Components().size(), 2);
BOOST_CHECK_EQUAL(systemModel.Components().at("N").Id(), "N");
Expand Down
11 changes: 5 additions & 6 deletions src/tests/src/study/system-model/test_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ BOOST_AUTO_TEST_SUITE(_System_)
BOOST_FIXTURE_TEST_CASE(nominal_build, SystemBuilderCreationFixture)
{
components = {createComponent("component1"), createComponent("component2")};
auto system = system_builder.withId("system")
.withComponents(components)
.build();
auto system = system_builder.withId("system").withComponents(components).build();
BOOST_CHECK_EQUAL(system.Id(), "system");
BOOST_CHECK_EQUAL(system.Components().size(), 2);
BOOST_CHECK_EQUAL(system.Components().at("component1").Id(), "component1");
Expand Down Expand Up @@ -88,9 +86,10 @@ BOOST_FIXTURE_TEST_CASE(fail_on_no_component2, SystemBuilderCreationFixture)

BOOST_FIXTURE_TEST_CASE(fail_on_components_with_same_id, SystemBuilderCreationFixture)
{
components = {createComponent("component1"), createComponent("component2"), createComponent("component2")};
system_builder.withId("system").withComponents(components).withComponents(
{components});
components = {createComponent("component1"),
createComponent("component2"),
createComponent("component2")};
system_builder.withId("system").withComponents(components).withComponents({components});
BOOST_CHECK_EXCEPTION(system_builder.build(),
std::invalid_argument,
checkMessage("System has at least two components with the same id "
Expand Down

0 comments on commit 2e5a875

Please sign in to comment.