Fixed assert_container_equal when container has no ::size()

release/4.3a0
Richard Roberts 2013-07-26 21:03:08 +00:00
parent 62d19c3d1f
commit 1671183cce
1 changed files with 2 additions and 2 deletions

View File

@ -231,8 +231,6 @@ bool assert_container_equal(const std::vector<std::pair<V1,V2> >& expected,
template<class V>
bool assert_container_equal(const V& expected, const V& actual, double tol = 1e-9) {
bool match = true;
if (expected.size() != actual.size())
match = false;
typename V::const_iterator
itExp = expected.begin(),
itAct = actual.begin();
@ -243,6 +241,8 @@ bool assert_container_equal(const V& expected, const V& actual, double tol = 1e-
break;
}
}
if(itExp != expected.end() || itAct != actual.end())
match = false;
}
if(!match) {
std::cout << "expected: " << std::endl;