Commit 3ff225a2 authored by Guilhem Saurel's avatar Guilhem Saurel

[Tests] Use a range-based for loop

to fix tests on Arch. Otherwise, an issue in the iterator raises:
unknown location(0): fatal error: in "StatsTests/contact_phase": signal: SIGSEGV, si_code: 128 (memory access violation at address: 0x00000000)
parent fdbad555
Pipeline #13349 passed with stage
in 10 minutes and 39 seconds
......@@ -827,9 +827,8 @@ BOOST_AUTO_TEST_CASE(contact_phase) {
cp2.addContactForceTrajectory("right_hand", buildRandomPolynomial12D());
cp2.addContactNormalForceTrajectory("right_hand", buildRandomPolynomial1D());
int num_ctc = 0;
for (ContactPhase::CurveMap_t::const_iterator mit = cp2.contactForces().begin(); mit != cp2.contactForces().end();
++mit) {
BOOST_CHECK(mit->first == "right_hand" || mit->first == "left_leg");
for (auto const& mit : cp2.contactForces()) {
BOOST_CHECK(mit.first == "right_hand" || mit.first == "left_leg");
num_ctc++;
}
BOOST_CHECK(num_ctc == 2);
......
Markdown is supported
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