Skip to content

Commit

Permalink
PRESUMED correct adjustmets to expected output--needs validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattw-nws committed Aug 8, 2023
1 parent 2085b94 commit befafbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions test/realizations/catchments/Bmi_C_Formulation_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ TEST_F(Bmi_C_Formulation_Test, GetOutputLineForTimestep_0_a) {

formulation.get_response(0, 3600);
std::string output = formulation.get_output_line_for_timestep(0, ",");
EXPECT_THAT(output, MatchesRegex("0.000000,0.000000"));
EXPECT_THAT(output, MatchesRegex("0.000000,571.600037"));
}

/** Simple test of output with modified variables. */
Expand All @@ -342,7 +342,7 @@ TEST_F(Bmi_C_Formulation_Test, GetOutputLineForTimestep_1_a) {
// OUTPUT_VAR_1 first.
formulation.get_response(0, 3600);
std::string output = formulation.get_output_line_for_timestep(0, ",");
EXPECT_THAT(output, MatchesRegex("0.000000,0.000000"));
EXPECT_THAT(output, MatchesRegex("571.600037,0.000000"));
}

/** Simple test of output with modified variables, picking time step when there was non-zero rain rate. */
Expand All @@ -357,7 +357,7 @@ TEST_F(Bmi_C_Formulation_Test, GetOutputLineForTimestep_1_b) {
formulation.get_response(i++, 3600);
formulation.get_response(i, 3600);
std::string output = formulation.get_output_line_for_timestep(i, ",");
EXPECT_THAT(output, MatchesRegex("0.000000,0.000001"));
EXPECT_THAT(output, MatchesRegex("580.799988,0.000001"));
}

TEST_F(Bmi_C_Formulation_Test, determine_model_time_offset_0_a) {
Expand Down
6 changes: 3 additions & 3 deletions test/realizations/catchments/Bmi_Cpp_Formulation_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ TEST_F(Bmi_Cpp_Formulation_Test, GetOutputLineForTimestep_0_a) {

formulation.get_response(0, 3600);
std::string output = formulation.get_output_line_for_timestep(0, ",");
ASSERT_EQ(output, "0.000000,0.000000");
ASSERT_EQ(output, "0.000000,571.600037");
}

/** Simple test of output with modified variables. */
Expand All @@ -319,7 +319,7 @@ TEST_F(Bmi_Cpp_Formulation_Test, GetOutputLineForTimestep_1_a) {
// OUTPUT_VAR_1 first.
formulation.get_response(0, 3600);
std::string output = formulation.get_output_line_for_timestep(0, ",");
ASSERT_EQ(output, "0.000000,0.000000");
ASSERT_EQ(output, "571.600037,0.000000");
}

/** Simple test of output with modified variables, picking time step when there was non-zero rain rate. */
Expand All @@ -334,7 +334,7 @@ TEST_F(Bmi_Cpp_Formulation_Test, GetOutputLineForTimestep_1_b) {
formulation.get_response(i++, 3600);
formulation.get_response(i, 3600);
std::string output = formulation.get_output_line_for_timestep(i, ",");
ASSERT_EQ(output, "0.000000,0.000001");
ASSERT_EQ(output, "580.799988,0.000001");
}

TEST_F(Bmi_Cpp_Formulation_Test, determine_model_time_offset_0_a) {
Expand Down
4 changes: 2 additions & 2 deletions test/realizations/catchments/Bmi_Py_Formulation_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ TEST_F(Bmi_Py_Formulation_Test, GetOutputLineForTimestep_0_a) {
double response = examples[ex_index].formulation->get_response(0, 3600);
std::string output = examples[ex_index].formulation->get_output_line_for_timestep(0, ",");
//NOTE the last two values are simply the FIRST element of the grid vars
ASSERT_EQ(output, "0.000000,0.000000,1.000000,2.000000,3.000000");
ASSERT_EQ(output, "0.000000,571.600037,1.000000,2.000000,3.000000");
}

/**
Expand All @@ -457,7 +457,7 @@ TEST_F(Bmi_Py_Formulation_Test, GetOutputLineForTimestep_0_b) {
double response = examples[ex_index].formulation->get_response(543, 3600);
std::string output = examples[ex_index].formulation->get_output_line_for_timestep(543, ",");
//NOTE the last two values are simply the FIRST element of the grid vars
std::regex expected ("0.000001,(-?)0.000000,544.000000,2.000001,3.000001");
std::regex expected ("0.000001,582.000000,544.000000,2.000001,3.000001");
ASSERT_TRUE(std::regex_match(output, expected));
}

Expand Down

0 comments on commit befafbc

Please sign in to comment.