Skip to content

Commit

Permalink
Quick fix
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 Oct 17, 2024
1 parent 813eff1 commit 73ff5d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/native_api_tests/test_api_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ TEST_CASE("API Model") {
SUBCASE("Input error handling") {
SUBCASE("Construction error") {
load_id = 0;
load_buffer.set_value(PGM_def_input_sym_load_id, &load_id, -1);
source_update_id = 1;
source_update_buffer.set_value(PGM_def_update_source_id, &source_update_id, 0, -1);
try {
Model const wrong_model{50.0, input_dataset};
} catch (PowerGridRegularError const& e) {
Expand All @@ -289,11 +292,14 @@ TEST_CASE("API Model") {
}

SUBCASE("Update error") {
load_id = 2;
load_buffer.set_value(PGM_def_input_sym_load_id, &load_id, -1);
source_update_id = 5;
source_update_buffer.set_value(PGM_def_update_source_id, &source_update_id, 0, -1);
try {
model.update(single_update_dataset);
} catch (PowerGridRegularError const& e) {
check_exception(e, PGM_regular_error, "The id cannot be found:"s);
check_exception(e, PGM_regular_error, "Wrong type for object with id "s);
}
}

Expand Down

0 comments on commit 73ff5d3

Please sign in to comment.