Skip to content

Commit

Permalink
Use std::shuffle instead of std::random_shuffle (robotology#1131)
Browse files Browse the repository at this point in the history
* Use std::shuffle instead of std::random_shuffle
  • Loading branch information
traversaro authored and flferretti committed Dec 23, 2024
1 parent e9de3e8 commit c1bf2cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/model_io/codecs/tests/URDFModelImportUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <random>

using namespace iDynTree;

Expand Down Expand Up @@ -198,7 +199,8 @@ void checkLoadReducedModelOrderIsKept(std::string urdfFileName)
}
}

std::random_shuffle(dofsName.begin(), dofsName.end());
std::mt19937 random_gen(0);
std::shuffle(dofsName.begin(), dofsName.end(), random_gen);

//now load the new model and check they are the same
ASSERT_IS_TRUE(loader.loadReducedModelFromFullModel(loadedModel, dofsName) && loader.isValid());
Expand Down

0 comments on commit c1bf2cd

Please sign in to comment.