From 39e1ffd645e18fbbd32cc33ab95406698ae29b0c Mon Sep 17 00:00:00 2001
From: Ben Cumming <bcumming@cscs.ch>
Date: Fri, 7 Oct 2016 15:59:46 +0200
Subject: [PATCH] address review comments for PR #22

---
 tests/unit/test_fvm_multi.cpp | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/tests/unit/test_fvm_multi.cpp b/tests/unit/test_fvm_multi.cpp
index 4592629c..7310d883 100644
--- a/tests/unit/test_fvm_multi.cpp
+++ b/tests/unit/test_fvm_multi.cpp
@@ -239,20 +239,13 @@ TEST(fvm_multi, mechanism_indexes)
     // iterate over mechanisms and test whether they were assigned to the correct CVs
     // TODO : this fails because we do not handle CVs at branching points (including soma) correctly
     for(auto& mech : fvcell.mechanisms()) {
-        auto const& ni = mech->node_index();
+        auto const& n = mech->node_index();
+        std::vector<unsigned> ni(n.begin(), n.end());
         if(mech->name()=="hh") {
-            EXPECT_EQ(ni.size(), hh_index.size());
-            // only check index by index if size of index arrays match
-            if(ni.size()==hh_index.size()) {
-                for(auto i : util::make_span(0u, ni.size())) EXPECT_EQ(ni[i], hh_index[i]);
-            }
+            EXPECT_EQ(ni, hh_index);
         }
         else if(mech->name()=="pas") {
-            EXPECT_EQ(ni.size(), pas_index.size());
-            // only check index by index if size of index arrays match
-            if(ni.size()==pas_index.size()) {
-                for(auto i : util::make_span(0u, ni.size())) EXPECT_EQ(ni[i], pas_index[i]);
-            }
+            EXPECT_EQ(ni, pas_index);
         }
     }
 }
-- 
GitLab