Skip to content

Commit

Permalink
Also fixes related issue if Fotran is turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
mattw-nws committed Apr 5, 2022
1 parent 118da31 commit 44e0bce
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ TEST_F(Bmi_Multi_Formulation_Test, GetResponse_3_b) {
* Test of get response in example 3, which uses a deferred provider, checking the values for several iterations.
*/
TEST_F(Bmi_Multi_Formulation_Test, GetResponse_3_c) {

/* Note that a runtime check in SetUp() prevents this from executing when it can't, but
this needs to be here to prevent compile-time errors if either of these flags is not
enabled. */
#if ACTIVATE_PYTHON && NGEN_BMI_FORTRAN_ACTIVE

int ex_index = 3;

Bmi_Multi_Formulation formulation(catchment_ids[ex_index], std::make_unique<CsvPerFeatureForcingProvider>(*forcing_params_examples[ex_index]), utils::StreamHandler());
Expand All @@ -666,9 +672,8 @@ TEST_F(Bmi_Multi_Formulation_Test, GetResponse_3_b) {
double response, mod_0_input_1, mod_1_output_2;
for (int i = 0; i < 39; i++) {
// Note that we need to get this before the "current" get_response ...
#if ACTIVATE_PYTHON
mod_1_output_2 = get_friend_nested_var_value<Bmi_Py_Formulation>(formulation, 1, "OUTPUT_VAR_2");
#endif

response = formulation.get_response(i, 3600);
// But we need to get this after the "current" get_response ...
mod_0_input_1 = get_friend_nested_var_value<Bmi_Fortran_Formulation>(formulation, 0, "INPUT_VAR_1");
Expand All @@ -677,6 +682,9 @@ TEST_F(Bmi_Multi_Formulation_Test, GetResponse_3_b) {
EXPECT_EQ(mod_0_input_1, mod_1_output_2);
}
}

#endif // ACTIVATE_PYTHON && NGEN_BMI_FORTRAN_ACTIVE

}

/**
Expand Down

0 comments on commit 44e0bce

Please sign in to comment.