Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
  • Loading branch information
Jerry-Jinfeng-Guo committed Jun 2, 2024
1 parent f5a9743 commit a895444
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/cpp_unit_tests/test_tap_position_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ auto normalized_lerp(IntS value, IntS start, IntS stop) {
return (static_cast<double>(value) - static_cast<double>(start)) /
(static_cast<double>(stop) - static_cast<double>(start));
}
void checkNormalTapRange(MockTransformerState& state_b, TransformerTapRegulator& regulator_b,
TransformerTapRegulatorUpdate& update_data, auto& check_b) {
void checkNormalTapRange(MockTransformerState& state_b, TransformerTapRegulatorUpdate& update_data, auto& check_b) {
state_b.tap_min = 1;
state_b.tap_max = 5;
state_b.tap_pos = 3;
Expand All @@ -584,8 +583,7 @@ void checkNormalTapRange(MockTransformerState& state_b, TransformerTapRegulator&
}
}

void checkInvertedTapRange(MockTransformerState& state_b, TransformerTapRegulator& regulator_b,
TransformerTapRegulatorUpdate& update_data, auto& check_b) {
void checkInvertedTapRange(MockTransformerState& state_b, TransformerTapRegulatorUpdate& update_data, auto& check_b) {
state_b.tap_min = 5;
state_b.tap_max = 1;
state_b.tap_pos = 3;
Expand Down Expand Up @@ -641,10 +639,10 @@ TEST_CASE("Test Tap position optimizer") {
return false;
}
std::vector<std::pair<IntS, IntS>> trafo_state_1, trafo_state_2;
for (auto const transformer : state1.components.template citer<MockTransformer>()) {
for (auto const& transformer : state1.components.template citer<MockTransformer>()) {
trafo_state_1.push_back({transformer.id(), transformer.tap_pos()});
}
for (auto const transformer : state2.components.template citer<MockTransformer>()) {
for (auto const& transformer : state2.components.template citer<MockTransformer>()) {
trafo_state_2.push_back({transformer.id(), transformer.tap_pos()});
}

Expand Down Expand Up @@ -831,8 +829,8 @@ TEST_CASE("Test Tap position optimizer") {

auto update_data = TransformerTapRegulatorUpdate{.id = 4, .u_set = 0.5, .u_band = 0.0};

SUBCASE("normal tap range") { checkNormalTapRange(state_b, regulator_b, update_data, check_b); }
SUBCASE("inverted tap range") { checkInvertedTapRange(state_b, regulator_b, update_data, check_b); }
SUBCASE("normal tap range") { checkNormalTapRange(state_b, update_data, check_b); }
SUBCASE("inverted tap range") { checkInvertedTapRange(state_b, update_data, check_b); }

regulator_b.update(update_data);
}
Expand Down

0 comments on commit a895444

Please sign in to comment.