diff options
Diffstat (limited to 'test/src')
| -rwxr-xr-x | test/src/unit/ActorTests.cpp | 6 | ||||
| -rwxr-xr-x | test/src/unit/AssetTests.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/src/unit/ActorTests.cpp b/test/src/unit/ActorTests.cpp index f25f6e4..7756e76 100755 --- a/test/src/unit/ActorTests.cpp +++ b/test/src/unit/ActorTests.cpp @@ -30,6 +30,7 @@ #include "AssetGenerator.h"
#include <map>
+#include <random>
#include <algorithm>
#include "NvBlastActor.h"
@@ -650,7 +651,10 @@ public: {
order[i] = i;
}
- std::random_shuffle(order.begin(), order.end());
+
+ std::random_device rd;
+ std::mt19937 g(rd());
+ std::shuffle(order.begin(), order.end(), g);
for (size_t i = 0; i < actors.size(); ++i)
{
diff --git a/test/src/unit/AssetTests.cpp b/test/src/unit/AssetTests.cpp index 6511f60..58ea7d1 100755 --- a/test/src/unit/AssetTests.cpp +++ b/test/src/unit/AssetTests.cpp @@ -33,6 +33,7 @@ #include "NvBlastTkFramework.h"
+#include <random>
#include <algorithm>
@@ -301,13 +302,16 @@ public: // An array into which to copy the reordered descs
std::vector<NvBlastChunkDesc> shuffledChunkDescs(chunkDescCount);
+ std::random_device rd;
+ std::mt19937 g(rd());
+
std::vector<char> scratch;
const uint32_t trials = 30;
uint32_t attempt = 0;
while(1)
{
// Shuffle the reorder array
- std::random_shuffle(shuffledOrder.begin(), shuffledOrder.end());
+ std::shuffle(shuffledOrder.begin(), shuffledOrder.end(), g);
// Save initial bonds
std::vector<NvBlastBondDesc> savedBondDescs(bondDescs, bondDescs + bondDescCount);
|