Skip to content

Commit

Permalink
[Tests] Use a range-based for loop
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
nim65s committed Jul 25, 2020
1 parent fdbad55 commit 3ff225a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions unittest/scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ff225a

Please sign in to comment.