From 73ff5d30752a4a63ac7ea50302f52f03fa951fe8 Mon Sep 17 00:00:00 2001 From: Jerry Guo Date: Thu, 17 Oct 2024 15:29:56 +0200 Subject: [PATCH] Quick fix Signed-off-by: Jerry Guo --- tests/native_api_tests/test_api_model.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/native_api_tests/test_api_model.cpp b/tests/native_api_tests/test_api_model.cpp index df46a05e2..658fd0769 100644 --- a/tests/native_api_tests/test_api_model.cpp +++ b/tests/native_api_tests/test_api_model.cpp @@ -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) { @@ -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); } }