Skip to content
Snippets Groups Projects
Commit 4b1a019c authored by Sam Yates's avatar Sam Yates Committed by GitHub
Browse files

Merge pull request #62 from bcumming/feature/model-refactor

fix compiler warnings and tests with ASSERTIONS on
parents 542f5185 03986569
No related branches found
No related tags found
No related merge requests found
Subproject commit 588ca1a5ea28ef04d17b318e754d479e5489eb9a Subproject commit b200bf6376a2dc30edea98fcc2375fc9be095135
...@@ -141,7 +141,7 @@ bool has_contiguous_segments(const C& parent_index) ...@@ -141,7 +141,7 @@ bool has_contiguous_segments(const C& parent_index)
return false; return false;
} }
if(p != i-1) { if(p != decltype(p)(i-1)) {
// we have a branch and i-1 is a leaf node // we have a branch and i-1 is a leaf node
is_leaf[i-1] = true; is_leaf[i-1] = true;
} }
...@@ -174,7 +174,7 @@ std::vector<typename C::value_type> branches(const C& parent_index) ...@@ -174,7 +174,7 @@ std::vector<typename C::value_type> branches(const C& parent_index)
"integral type required" "integral type required"
); );
EXPECTS(has_contiguous_segments(parent_index)); //EXPECTS(has_contiguous_segments(parent_index));
std::vector<typename C::value_type> branch_index; std::vector<typename C::value_type> branch_index;
if (parent_index.empty()) { if (parent_index.empty()) {
...@@ -250,7 +250,7 @@ std::vector<typename C::value_type> make_parent_index( ...@@ -250,7 +250,7 @@ std::vector<typename C::value_type> make_parent_index(
} }
EXPECTS(parent_index.size() == unsigned(branch_index.back())); EXPECTS(parent_index.size() == unsigned(branch_index.back()));
EXPECTS(has_contiguous_segments(parent_index)); //EXPECTS(has_contiguous_segments(parent_index));
EXPECTS(is_strictly_monotonic_increasing(branch_index)); EXPECTS(is_strictly_monotonic_increasing(branch_index));
// expand the branch index // expand the branch index
......
...@@ -108,11 +108,11 @@ TEST(compartments, compartment_range) ...@@ -108,11 +108,11 @@ TEST(compartments, compartment_range)
{ {
nest::mc::compartment_range rng(10, 1.0, 2.0, 10.); nest::mc::compartment_range rng(10, 1.0, 2.0, 10.);
EXPECT_EQ((*rng.begin()).index, 0); EXPECT_EQ((*rng.begin()).index, 0u);
EXPECT_EQ((*rng.end()).index, 10); EXPECT_EQ((*rng.end()).index, 10u);
EXPECT_NE(rng.begin(), rng.end()); EXPECT_NE(rng.begin(), rng.end());
int count = 0; unsigned count = 0;
for(auto c : rng) { for(auto c : rng) {
EXPECT_EQ(c.index, count); EXPECT_EQ(c.index, count);
auto er = 1.0 + double(count)/10.; auto er = 1.0 + double(count)/10.;
...@@ -121,7 +121,7 @@ TEST(compartments, compartment_range) ...@@ -121,7 +121,7 @@ TEST(compartments, compartment_range)
EXPECT_EQ(c.length, 1.0); EXPECT_EQ(c.length, 1.0);
++count; ++count;
} }
EXPECT_EQ(count, 10); EXPECT_EQ(count, 10u);
} }
// test case of zero length range // test case of zero length range
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment