Commit c0981793 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[Tests] use std::list

fix:
…/hpp-core/tests/roadmap-1.cc:298:20:   required from here
/usr/include/c++/10.2.0/bits/stl_function.h:386:20: erreur: no match for « operator< » (operand types are
« const std::weak_ptr<hpp::core::ConnectedComponent> » and
« const std::weak_ptr<hpp::core::ConnectedComponent> »)
  386 |       { return __x < __y; }
      |                ~~~~^~~~~

We don't need any ordering here.

Plus it's faster.
parent 990599b5
...@@ -292,13 +292,13 @@ BOOST_AUTO_TEST_CASE (Roadmap1) { ...@@ -292,13 +292,13 @@ BOOST_AUTO_TEST_CASE (Roadmap1) {
BOOST_TEST_MESSAGE(*r); BOOST_TEST_MESSAGE(*r);
// Check that memory if well deallocated. // Check that memory if well deallocated.
std::set<ConnectedComponentWkPtr_t> ccs; std::list<ConnectedComponentWkPtr_t> ccs;
for (ConnectedComponents_t::const_iterator _cc = r->connectedComponents().begin(); for (ConnectedComponents_t::const_iterator _cc = r->connectedComponents().begin();
_cc != r->connectedComponents().end(); ++_cc) _cc != r->connectedComponents().end(); ++_cc)
ccs.insert(*_cc); ccs.push_back(*_cc);
r.reset(); r.reset();
for (std::set<ConnectedComponentWkPtr_t>::const_iterator _cc = ccs.begin(); for (std::list<ConnectedComponentWkPtr_t>::const_iterator _cc = ccs.begin();
_cc != ccs.begin(); ++_cc) { _cc != ccs.begin(); ++_cc) {
BOOST_CHECK (! _cc->lock()); BOOST_CHECK (! _cc->lock());
} }
......
Supports Markdown
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