Skip to content

Commit

Permalink
fix C++ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea-Havron-NOAA committed Aug 26, 2024
1 parent 22b64b6 commit 11195c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/gtest/test_population_dynamics_maturity_logistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ namespace
{

fims_popdy::LogisticMaturity<double> maturity;
maturity.inflection_point.resize(1);
maturity.inflection_point[0] = 20.5;
maturity.slope.resize(1);
maturity.slope[0] = 0.15;
double maturity_x = 40.5;
// 1.0/(1.0+exp(-(40.5-20.5)*0.15)) = 0.9525741
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/integration_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class IntegrationTest {
if ((*it).second.GetType() == JsonValueType::Array) {
double r0 = (*it).second.GetArray()[0].GetDouble();
rec->log_rzero.resize(1);
rec->log_rzero = std::log(r0);
rec->log_rzero[0] = std::log(r0);
if (print_statements) {
std::cout << "R0 " << rec->log_rzero[0] << "| \n";
}
Expand All @@ -535,7 +535,8 @@ class IntegrationTest {
it = obj.find("h");
if (it != obj.end()) {
if ((*it).second.GetType() == JsonValueType::Array) {
rec->logit_steep = fims_math::logit(0.2, 1.0, (*it).second.GetArray()[0].GetDouble());
rec->logit_steep.resize(1);
rec->logit_steep[0] = fims_math::logit(0.2, 1.0, (*it).second.GetArray()[0].GetDouble());
if (print_statements) {
std::cout << "'h' " << rec->logit_steep[0] << " \n";
}
Expand All @@ -550,7 +551,7 @@ class IntegrationTest {
if (it != obj.end()) {
if ((*it).second.GetType() == JsonValueType::Array) {
rec->log_sigma_recruit.resize(1);
rec->log_sigma_recruit = (*it).second.GetArray()[0].GetDouble();
rec->log_sigma_recruit[0] = (*it).second.GetArray()[0].GetDouble();
if (print_statements) {
std::cout << "'SD' " << rec->log_sigma_recruit[0] << " \n";
}
Expand Down

0 comments on commit 11195c4

Please sign in to comment.