Skip to content

Commit

Permalink
Revise realization config and unit test code
Browse files Browse the repository at this point in the history
  • Loading branch information
stcui007 committed Sep 27, 2024
1 parent fa48369 commit 8887d1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions data/example_domainlayer_realization_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"layer_name": "domain_layer",
"time_step_units": "s",
"id": 0,
"id": 1,
"time_step": 3600,
"domain": "catchments"
},
Expand Down Expand Up @@ -89,7 +89,7 @@
},
"layer_name": "domain_layer",
"time_step_units": "s",
"id": 0,
"id": 2,
"time_step": 3600,
"domain": "catchments"
},
Expand Down Expand Up @@ -117,7 +117,7 @@
},
"layer_name": "domain_layer",
"time_step_units": "s",
"id": 0,
"id": 3,
"time_step": 3600,
"domain": "catchments"
}
Expand Down
11 changes: 8 additions & 3 deletions test/core/multilayer/DomainLayerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,21 @@ TEST_F(DomainLayerTest, TestRead0)
double c_value = UnitsHelper::get_converted_value(m_data.time_step_units,m_data.time_step,"s");
time_steps.push_back(c_value);
}
boost::range::sort(keys, std::greater<int>());
//boost::range::sort(keys, std::greater<int>());
boost::range::sort(keys);
std::vector<std::shared_ptr<ngen::Layer> > layers;
layers.resize(keys.size());

for(long i = 0; i < keys.size(); ++i)
{
auto desc = layer_meta_data.get_layer(keys[i]);
ASSERT_EQ(desc.name, "domain_layer");
if (i == 0) {
ASSERT_EQ(desc.name, "surface layer");
} else {
ASSERT_EQ(desc.name, "domain_layer");
}
ASSERT_EQ(desc.time_step_units, "s");
ASSERT_EQ(desc.id, 0);
ASSERT_EQ(desc.id, i);
ASSERT_EQ(desc.time_step, 3600);
}

Expand Down

0 comments on commit 8887d1e

Please sign in to comment.