From 94c4e4c3b4d2b1e8922070ff9d98bbd9dd385b1b Mon Sep 17 00:00:00 2001
From: khizmax <libcds.dev@gmail.com>
Date: Thu, 9 Apr 2015 22:19:35 +0300
Subject: [PATCH] Issue #23: removed std::random_shuffle from tests

---
 tests/test-hdr/list/hdr_intrusive_lazy.h             | 4 ++--
 tests/test-hdr/list/hdr_intrusive_michael.h          | 4 ++--
 tests/test-hdr/list/hdr_lazy.h                       | 4 ++--
 tests/test-hdr/list/hdr_lazy_kv.h                    | 4 ++--
 tests/test-hdr/list/hdr_michael.h                    | 4 ++--
 tests/test-hdr/list/hdr_michael_kv.h                 | 4 ++--
 tests/test-hdr/map/hdr_cuckoo_map.h                  | 1 -
 tests/test-hdr/map/hdr_map.h                         | 5 ++---
 tests/test-hdr/map/hdr_skiplist_map.h                | 4 ++--
 tests/test-hdr/map/hdr_skiplist_map_rcu.h            | 4 ++--
 tests/test-hdr/map/hdr_striped_map.h                 | 1 -
 tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h | 2 +-
 tests/test-hdr/priority_queue/hdr_pqueue.h           | 2 +-
 tests/test-hdr/set/hdr_cuckoo_set.h                  | 1 -
 tests/test-hdr/set/hdr_intrusive_set.h               | 5 ++---
 tests/test-hdr/set/hdr_intrusive_skiplist_set.h      | 2 +-
 tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h  | 2 +-
 tests/test-hdr/set/hdr_set.h                         | 5 ++---
 tests/test-hdr/set/hdr_skiplist_set.h                | 2 +-
 tests/test-hdr/set/hdr_skiplist_set_rcu.h            | 2 +-
 tests/test-hdr/set/hdr_striped_set.h                 | 1 -
 tests/test-hdr/tree/hdr_bronson_avltree_map.h        | 2 +-
 tests/test-hdr/tree/hdr_ellenbintree_map.h           | 2 +-
 tests/test-hdr/tree/hdr_ellenbintree_set.h           | 2 +-
 tests/test-hdr/tree/hdr_intrusive_bintree.h          | 2 +-
 tests/unit/map2/map_find_int.cpp                     | 2 +-
 tests/unit/map2/map_find_int.h                       | 1 -
 tests/unit/map2/map_insdel_func.h                    | 3 +--
 tests/unit/map2/map_insdel_int.h                     | 2 +-
 tests/unit/map2/map_insdel_item_int.h                | 3 +--
 tests/unit/map2/map_insdelfind.cpp                   | 2 +-
 tests/unit/map2/map_insdelfind.h                     | 3 +--
 tests/unit/map2/map_insfind_int.h                    | 3 +--
 tests/unit/pqueue/pop.cpp                            | 3 +--
 tests/unit/pqueue/push.cpp                           | 3 +--
 tests/unit/pqueue/push_pop.cpp                       | 3 +--
 tests/unit/set2/set_delodd.cpp                       | 2 +-
 tests/unit/set2/set_delodd.h                         | 1 -
 tests/unit/set2/set_insdel_func.h                    | 2 +-
 tests/unit/set2/set_insdelfind.cpp                   | 2 +-
 tests/unit/set2/set_insdelfind.h                     | 3 +--
 41 files changed, 46 insertions(+), 63 deletions(-)

diff --git a/tests/test-hdr/list/hdr_intrusive_lazy.h b/tests/test-hdr/list/hdr_intrusive_lazy.h
index 83615fff..802bfbbf 100644
--- a/tests/test-hdr/list/hdr_intrusive_lazy.h
+++ b/tests/test-hdr/list/hdr_intrusive_lazy.h
@@ -474,7 +474,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 for (int i = 0; i < nLimit; ++i) {
                     arrItem[i].nKey = a[i];
@@ -567,7 +567,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 for (int i = 0; i < nLimit; ++i) {
                     arrItem[i].nKey = a[i];
diff --git a/tests/test-hdr/list/hdr_intrusive_michael.h b/tests/test-hdr/list/hdr_intrusive_michael.h
index 05248f66..c19f07bb 100644
--- a/tests/test-hdr/list/hdr_intrusive_michael.h
+++ b/tests/test-hdr/list/hdr_intrusive_michael.h
@@ -464,7 +464,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 for (int i = 0; i < nLimit; ++i) {
                     arrItem[i].nKey = a[i];
@@ -563,7 +563,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 for (int i = 0; i < nLimit; ++i) {
                     arrItem[i].nKey = a[i];
diff --git a/tests/test-hdr/list/hdr_lazy.h b/tests/test-hdr/list/hdr_lazy.h
index a77ffd7c..84f25544 100644
--- a/tests/test-hdr/list/hdr_lazy.h
+++ b/tests/test-hdr/list/hdr_lazy.h
@@ -483,7 +483,7 @@ namespace ordlist {
             int arr[nLimit];
             for ( int i = 0; i < nLimit; i++ )
                 arr[i] = i;
-            std::random_shuffle( arr, arr + nLimit );
+            shuffle( arr, arr + nLimit );
 
             // extract/get
             for ( int i = 0; i < nLimit; ++i )
@@ -574,7 +574,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 // extract/get
                 for ( int i = 0; i < nLimit; ++i )
diff --git a/tests/test-hdr/list/hdr_lazy_kv.h b/tests/test-hdr/list/hdr_lazy_kv.h
index c719ac89..4752625d 100644
--- a/tests/test-hdr/list/hdr_lazy_kv.h
+++ b/tests/test-hdr/list/hdr_lazy_kv.h
@@ -298,7 +298,7 @@ namespace ordlist {
             int arr[nLimit];
             for ( int i = 0; i < nLimit; i++ )
                 arr[i] = i;
-            std::random_shuffle( arr, arr + nLimit );
+            shuffle( arr, arr + nLimit );
 
             // extract/get
             for ( int i = 0; i < nLimit; ++i )
@@ -388,7 +388,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 // extract/get
                 for ( int i = 0; i < nLimit; ++i )
diff --git a/tests/test-hdr/list/hdr_michael.h b/tests/test-hdr/list/hdr_michael.h
index c37eaa8e..06a666b1 100644
--- a/tests/test-hdr/list/hdr_michael.h
+++ b/tests/test-hdr/list/hdr_michael.h
@@ -463,7 +463,7 @@ namespace ordlist {
             int arr[nLimit];
             for ( int i = 0; i < nLimit; i++ )
                 arr[i] = i;
-            std::random_shuffle( arr, arr + nLimit );
+            shuffle( arr, arr + nLimit );
 
             // extract/get
             for ( int i = 0; i < nLimit; ++i )
@@ -553,7 +553,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 // extract/get
                 for ( int i = 0; i < nLimit; ++i )
diff --git a/tests/test-hdr/list/hdr_michael_kv.h b/tests/test-hdr/list/hdr_michael_kv.h
index 4f467b31..281bddee 100644
--- a/tests/test-hdr/list/hdr_michael_kv.h
+++ b/tests/test-hdr/list/hdr_michael_kv.h
@@ -300,7 +300,7 @@ namespace ordlist {
             int arr[nLimit];
             for ( int i = 0; i < nLimit; i++ )
                 arr[i] = i;
-            std::random_shuffle( arr, arr + nLimit );
+            shuffle( arr, arr + nLimit );
 
             // extract/get
             for ( int i = 0; i < nLimit; ++i )
@@ -391,7 +391,7 @@ namespace ordlist {
                 int a[nLimit];
                 for (int i = 0; i < nLimit; ++i)
                     a[i]=i;
-                std::random_shuffle( a, a + nLimit );
+                shuffle( a, a + nLimit );
 
                 // extract/get
                 for ( int i = 0; i < nLimit; ++i )
diff --git a/tests/test-hdr/map/hdr_cuckoo_map.h b/tests/test-hdr/map/hdr_cuckoo_map.h
index aef80094..d2429118 100644
--- a/tests/test-hdr/map/hdr_cuckoo_map.h
+++ b/tests/test-hdr/map/hdr_cuckoo_map.h
@@ -8,7 +8,6 @@
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
 
diff --git a/tests/test-hdr/map/hdr_map.h b/tests/test-hdr/map/hdr_map.h
index 327090db..8db81e98 100644
--- a/tests/test-hdr/map/hdr_map.h
+++ b/tests/test-hdr/map/hdr_map.h
@@ -8,7 +8,6 @@
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
 
@@ -202,7 +201,7 @@ namespace map {
                 int arrRandom[nLimit];
                 for ( int i = 0; i < nLimit; ++i )
                     arrRandom[i] = i;
-                std::random_shuffle( arrRandom, arrRandom + nLimit );
+                shuffle( arrRandom, arrRandom + nLimit );
 
                 for ( int i = 0; i < nLimit; ++i )
                     CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
@@ -281,7 +280,7 @@ namespace map {
                 int arr[nLimit];
                 for ( size_t i = 0; i < nLimit; ++i )
                     arr[i] = (int) i;
-                std::random_shuffle( arr, arr + nLimit );
+                shuffle( arr, arr + nLimit );
 
                 for ( size_t i = 0; i < nLimit; ++i )
                     CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
diff --git a/tests/test-hdr/map/hdr_skiplist_map.h b/tests/test-hdr/map/hdr_skiplist_map.h
index d919a1d2..5b57a815 100644
--- a/tests/test-hdr/map/hdr_skiplist_map.h
+++ b/tests/test-hdr/map/hdr_skiplist_map.h
@@ -102,7 +102,7 @@ namespace map {
                 for ( int i = 0; i < nLimit; ++i ) {
                     nRand[i] = i;
                 }
-                std::random_shuffle( nRand, nRand + nLimit );
+                shuffle( nRand, nRand + nLimit );
 
                 for ( int i = 0; i < nLimit; ++i ) {
                     CPPUNIT_ASSERT( m.insert( nRand[i], nRand[i]) );
@@ -140,7 +140,7 @@ namespace map {
                 int arrItem[nLimit];
                 for ( int i = 0; i < nLimit; ++i )
                     arrItem[i] = i;
-                std::random_shuffle( arrItem, arrItem + nLimit );
+                shuffle( arrItem, arrItem + nLimit );
 
                 typedef base_class::less less;
 
diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu.h b/tests/test-hdr/map/hdr_skiplist_map_rcu.h
index 6526e2c6..70a0dd65 100644
--- a/tests/test-hdr/map/hdr_skiplist_map_rcu.h
+++ b/tests/test-hdr/map/hdr_skiplist_map_rcu.h
@@ -115,7 +115,7 @@ namespace map {
                 for ( int i = 0; i < nLimit; ++i ) {
                     nRand[i] = i;
                 }
-                std::random_shuffle( nRand, nRand + nLimit );
+                shuffle( nRand, nRand + nLimit );
 
                 for ( int i = 0; i < nLimit; ++i ) {
                     CPPUNIT_ASSERT( m.insert(i, i) );
@@ -158,7 +158,7 @@ namespace map {
                 int arrItem[nLimit];
                 for ( int i = 0; i < nLimit; ++i )
                     arrItem[i] = i;
-                std::random_shuffle( arrItem, arrItem + nLimit );
+                shuffle( arrItem, arrItem + nLimit );
 
                 typedef typename Map::value_type value_type;
                 typename Map::exempt_ptr ep;
diff --git a/tests/test-hdr/map/hdr_striped_map.h b/tests/test-hdr/map/hdr_striped_map.h
index edaade8c..9d5b35b9 100644
--- a/tests/test-hdr/map/hdr_striped_map.h
+++ b/tests/test-hdr/map/hdr_striped_map.h
@@ -8,7 +8,6 @@
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
 
diff --git a/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h b/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h
index 268f1c13..7824fdbc 100644
--- a/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h
+++ b/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h
@@ -62,7 +62,7 @@ namespace priority_queue {
                 for ( T * p = pFirst; p != pLast; ++p, ++i )
                     *p = i;
 
-                std::random_shuffle( pFirst, pLast );
+                shuffle( pFirst, pLast );
             }
 
             ~data_array()
diff --git a/tests/test-hdr/priority_queue/hdr_pqueue.h b/tests/test-hdr/priority_queue/hdr_pqueue.h
index eadbc7e2..b05dd8fa 100644
--- a/tests/test-hdr/priority_queue/hdr_pqueue.h
+++ b/tests/test-hdr/priority_queue/hdr_pqueue.h
@@ -98,7 +98,7 @@ namespace priority_queue {
                 for ( T * p = pFirst; p != pLast; ++p, ++i )
                     p->k = p->v = i;
 
-                std::random_shuffle( pFirst, pLast );
+                shuffle( pFirst, pLast );
             }
 
             ~data_array()
diff --git a/tests/test-hdr/set/hdr_cuckoo_set.h b/tests/test-hdr/set/hdr_cuckoo_set.h
index 8c808653..36742936 100644
--- a/tests/test-hdr/set/hdr_cuckoo_set.h
+++ b/tests/test-hdr/set/hdr_cuckoo_set.h
@@ -9,7 +9,6 @@
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 // forward namespace declaration
 namespace cds {
diff --git a/tests/test-hdr/set/hdr_intrusive_set.h b/tests/test-hdr/set/hdr_intrusive_set.h
index 48ed8c98..7da9e154 100644
--- a/tests/test-hdr/set/hdr_intrusive_set.h
+++ b/tests/test-hdr/set/hdr_intrusive_set.h
@@ -8,7 +8,6 @@
 
 #include <cds/opt/hash.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 // forward declaration
 namespace cds { namespace intrusive {} }
@@ -493,7 +492,7 @@ namespace set {
                 int arr[nLimit];
                 for ( size_t i = 0; i < nLimit; ++i )
                     arr[i] = (int) i;
-                std::random_shuffle( arr, arr + nLimit );
+                shuffle( arr, arr + nLimit );
 
                 for ( size_t i = 0; i < nLimit; ++i ) {
                     arrItems[i].nKey = arr[i];
@@ -1022,7 +1021,7 @@ namespace set {
                 int arr[nLimit];
                 for ( size_t i = 0; i < nLimit; ++i )
                     arr[i] = (int) i;
-                std::random_shuffle( arr, arr + nLimit );
+                shuffle( arr, arr + nLimit );
 
                 for ( size_t i = 0; i < nLimit; ++i ) {
                     arrItems[i].nKey = arr[i];
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
index 60549192..6d882bde 100644
--- a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
+++ b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
@@ -333,7 +333,7 @@ namespace set {
             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
                 nRand[i] = i;
             }
-            std::random_shuffle( nRand, nRand + c_nArrSize );
+            shuffle( nRand, nRand + c_nArrSize );
 
             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
                 pArr[i].nKey = nRand[i];
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h b/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
index 68574753..d4898a04 100644
--- a/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
+++ b/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
@@ -384,7 +384,7 @@ namespace set {
             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
                 nRand[i] = i;
             }
-            std::random_shuffle( nRand, nRand + c_nArrSize );
+            shuffle( nRand, nRand + c_nArrSize );
 
             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
                 pArr[i].nKey = nRand[i];
diff --git a/tests/test-hdr/set/hdr_set.h b/tests/test-hdr/set/hdr_set.h
index 643b7c25..aeaa2ac3 100644
--- a/tests/test-hdr/set/hdr_set.h
+++ b/tests/test-hdr/set/hdr_set.h
@@ -9,7 +9,6 @@
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 // forward namespace declaration
 namespace cds {
@@ -353,7 +352,7 @@ namespace set {
                 int arrRandom[nLimit];
                 for ( int i = 0; i < nLimit; ++i )
                     arrRandom[i] = i;
-                std::random_shuffle( arrRandom, arrRandom + nLimit );
+                shuffle( arrRandom, arrRandom + nLimit );
 
                 for ( int i = 0; i < nLimit; ++i )
                     CPPUNIT_ASSERT( s.insert( arrRandom[i] ));
@@ -431,7 +430,7 @@ namespace set {
                 int arr[nLimit];
                 for ( size_t i = 0; i < nLimit; ++i )
                     arr[i] = (int) i;
-                std::random_shuffle( arr, arr + nLimit );
+                shuffle( arr, arr + nLimit );
 
                 for ( size_t i = 0; i < nLimit; ++i )
                     CPPUNIT_ASSERT( s.insert( arr[i] ));
diff --git a/tests/test-hdr/set/hdr_skiplist_set.h b/tests/test-hdr/set/hdr_skiplist_set.h
index 73317055..31ed8779 100644
--- a/tests/test-hdr/set/hdr_skiplist_set.h
+++ b/tests/test-hdr/set/hdr_skiplist_set.h
@@ -31,7 +31,7 @@ namespace set {
             int arrRandom[nLimit];
             for ( int i = 0; i < nLimit; ++i )
                 arrRandom[i] = i;
-            std::random_shuffle( arrRandom, arrRandom + nLimit );
+            shuffle( arrRandom, arrRandom + nLimit );
 
 
             // Test iterator - ascending order
diff --git a/tests/test-hdr/set/hdr_skiplist_set_rcu.h b/tests/test-hdr/set/hdr_skiplist_set_rcu.h
index 0f8305cb..c655ed18 100644
--- a/tests/test-hdr/set/hdr_skiplist_set_rcu.h
+++ b/tests/test-hdr/set/hdr_skiplist_set_rcu.h
@@ -31,7 +31,7 @@ namespace set {
             int arrRandom[nLimit];
             for ( int i = 0; i < nLimit; ++i )
                 arrRandom[i] = i;
-            std::random_shuffle( arrRandom, arrRandom + nLimit );
+            shuffle( arrRandom, arrRandom + nLimit );
 
             // Test iterator - ascending order
             s.clear();
diff --git a/tests/test-hdr/set/hdr_striped_set.h b/tests/test-hdr/set/hdr_striped_set.h
index e9b0e5aa..3ff6a3c3 100644
--- a/tests/test-hdr/set/hdr_striped_set.h
+++ b/tests/test-hdr/set/hdr_striped_set.h
@@ -9,7 +9,6 @@
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
 #include <functional>   // ref
-#include <algorithm>    // random_shuffle
 
 // forward namespace declaration
 namespace cds {
diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map.h b/tests/test-hdr/tree/hdr_bronson_avltree_map.h
index b6ffe24b..7db25747 100644
--- a/tests/test-hdr/tree/hdr_bronson_avltree_map.h
+++ b/tests/test-hdr/tree/hdr_bronson_avltree_map.h
@@ -313,7 +313,7 @@ namespace tree {
             int keys[1000];
             for ( key_type i = 0; i < static_cast<key_type>(sizeof(keys) / sizeof(keys[0])); ++i )
                 keys[i] = i;
-            std::random_shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
+            shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
 
             size_t nCount = 1;
             int nPrev;
diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map.h b/tests/test-hdr/tree/hdr_ellenbintree_map.h
index 0053187d..42811d00 100644
--- a/tests/test-hdr/tree/hdr_ellenbintree_map.h
+++ b/tests/test-hdr/tree/hdr_ellenbintree_map.h
@@ -186,7 +186,7 @@ namespace tree {
                 for ( int * p = pFirst; p != pLast; ++p, ++i )
                     *p = i;
 
-                std::random_shuffle( pFirst, pLast );
+                shuffle( pFirst, pLast );
             }
 
             ~data_array()
diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set.h b/tests/test-hdr/tree/hdr_ellenbintree_set.h
index 5d3b2aef..98668fc6 100644
--- a/tests/test-hdr/tree/hdr_ellenbintree_set.h
+++ b/tests/test-hdr/tree/hdr_ellenbintree_set.h
@@ -187,7 +187,7 @@ namespace tree {
                 for ( int * p = pFirst; p != pLast; ++p, ++i )
                     *p = i;
 
-                std::random_shuffle( pFirst, pLast );
+                shuffle( pFirst, pLast );
             }
 
             ~data_array()
diff --git a/tests/test-hdr/tree/hdr_intrusive_bintree.h b/tests/test-hdr/tree/hdr_intrusive_bintree.h
index af2fb8ac..f511966c 100644
--- a/tests/test-hdr/tree/hdr_intrusive_bintree.h
+++ b/tests/test-hdr/tree/hdr_intrusive_bintree.h
@@ -261,7 +261,7 @@ namespace tree {
                     p->nValue = i * 2;
                 }
 
-                std::random_shuffle( pFirst, pLast );
+                shuffle( pFirst, pLast );
             }
 
             ~data_array()
diff --git a/tests/unit/map2/map_find_int.cpp b/tests/unit/map2/map_find_int.cpp
index 5b201ff8..7eddd466 100644
--- a/tests/unit/map2/map_find_int.cpp
+++ b/tests/unit/map2/map_find_int.cpp
@@ -33,7 +33,7 @@ namespace map2 {
             if ( m_Arr[i].bExists )
                 ++m_nRealMapSize;
         }
-        std::random_shuffle( m_Arr.begin(), m_Arr.end() );
+        shuffle( m_Arr.begin(), m_Arr.end() );
     }
 
     void Map_find_int::initTestSequence()
diff --git a/tests/unit/map2/map_find_int.h b/tests/unit/map2/map_find_int.h
index 77bbb81d..b7f54789 100644
--- a/tests/unit/map2/map_find_int.h
+++ b/tests/unit/map2/map_find_int.h
@@ -6,7 +6,6 @@
 #include "cppunit/thread.h"
 
 #include <vector>
-#include <algorithm> // random_shuffle
 
 // find int test in map<int> in mutithreaded mode
 namespace map2 {
diff --git a/tests/unit/map2/map_insdel_func.h b/tests/unit/map2/map_insdel_func.h
index 92f88f2d..e4e075b4 100644
--- a/tests/unit/map2/map_insdel_func.h
+++ b/tests/unit/map2/map_insdel_func.h
@@ -7,7 +7,6 @@
 
 #include <cds/sync/spinlock.h>
 #include <vector>
-#include <algorithm>    // random_shuffle
 
 namespace map2 {
 
@@ -414,7 +413,7 @@ namespace map2 {
             m_arrValues.reserve( c_nMapSize );
             for ( size_t i = 0; i < c_nMapSize; ++i )
                 m_arrValues.push_back( i );
-            std::random_shuffle( m_arrValues.begin(), m_arrValues.end() );
+            shuffle( m_arrValues.begin(), m_arrValues.end() );
 
             CppUnitMini::ThreadPool pool( *this );
             pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount );
diff --git a/tests/unit/map2/map_insdel_int.h b/tests/unit/map2/map_insdel_int.h
index 51a3c7dc..757a7acf 100644
--- a/tests/unit/map2/map_insdel_int.h
+++ b/tests/unit/map2/map_insdel_int.h
@@ -164,7 +164,7 @@ namespace map2 {
             m_arrValues.reserve( c_nMapSize );
             for ( size_t i = 0; i < c_nMapSize; ++i )
                 m_arrValues.push_back( i );
-            std::random_shuffle( m_arrValues.begin(), m_arrValues.end() );
+            shuffle( m_arrValues.begin(), m_arrValues.end() );
 
             CppUnitMini::ThreadPool pool( *this );
             pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount );
diff --git a/tests/unit/map2/map_insdel_item_int.h b/tests/unit/map2/map_insdel_item_int.h
index fc7a2db4..298b970b 100644
--- a/tests/unit/map2/map_insdel_item_int.h
+++ b/tests/unit/map2/map_insdel_item_int.h
@@ -4,7 +4,6 @@
 #include "cppunit/thread.h"
 
 #include <vector>
-#include <algorithm>    // random_shuffle
 
 namespace map2 {
 
@@ -177,7 +176,7 @@ namespace map2 {
                 v.reserve( c_nMapSize );
                 for ( size_t i = 0; i < c_nMapSize; ++i )
                     v.push_back( i );
-                std::random_shuffle( v.begin(), v.end() );
+                shuffle( v.begin(), v.end() );
                 for ( size_t i = 0; i < v.size(); ++i ) {
                     CPPUNIT_ASSERT( testMap.insert( v[i], v[i] ));
                 }
diff --git a/tests/unit/map2/map_insdelfind.cpp b/tests/unit/map2/map_insdelfind.cpp
index e5d56bb5..08f8a32d 100644
--- a/tests/unit/map2/map_insdelfind.cpp
+++ b/tests/unit/map2/map_insdelfind.cpp
@@ -38,7 +38,7 @@ namespace map2 {
         pFirst = pLast;
         pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
         std::fill( pFirst, pLast, do_find );
-        std::random_shuffle( m_arrShuffle, pLast );
+        shuffle( m_arrShuffle, pLast );
     }
 
     void Map_InsDelFind::myRun(const char *in_name, bool invert /*= false*/)
diff --git a/tests/unit/map2/map_insdelfind.h b/tests/unit/map2/map_insdelfind.h
index 1b689c6c..cf88b9c6 100644
--- a/tests/unit/map2/map_insdelfind.h
+++ b/tests/unit/map2/map_insdelfind.h
@@ -2,7 +2,6 @@
 
 #include "map2/map_type.h"
 #include "cppunit/thread.h"
-#include <algorithm> // random_shuffle
 #include <vector>
 
 namespace map2 {
@@ -131,7 +130,7 @@ namespace map2 {
                 arr.reserve( c_nInitialMapSize );
                 for ( size_t i = 0; i < c_nInitialMapSize; ++i )
                     arr.push_back( i * 2 + 1);
-                std::random_shuffle( arr.begin(), arr.end() );
+                shuffle( arr.begin(), arr.end() );
                 for ( size_t i = 0; i < c_nInitialMapSize; ++i )
                     testMap.insert( arr[i], arr[i] );
             }
diff --git a/tests/unit/map2/map_insfind_int.h b/tests/unit/map2/map_insfind_int.h
index 0eb0fc2f..3f463095 100644
--- a/tests/unit/map2/map_insfind_int.h
+++ b/tests/unit/map2/map_insfind_int.h
@@ -5,7 +5,6 @@
 
 #include <cds/os/topology.h>
 #include <vector>
-#include <algorithm> // random_shuffle
 
 namespace map2 {
 
@@ -54,7 +53,7 @@ namespace map2 {
                 size_t nItem = m_nThreadNo;
                 for ( size_t i = 0; i < nSize; nItem += c_nThreadCount, ++i )
                     m_arrVal[i] = nItem;
-                std::random_shuffle( m_arrVal.begin(), m_arrVal.end() );
+                shuffle( m_arrVal.begin(), m_arrVal.end() );
             }
         public:
             size_t  m_nInsertSuccess;
diff --git a/tests/unit/pqueue/pop.cpp b/tests/unit/pqueue/pop.cpp
index 3bb42d9b..30e144e7 100644
--- a/tests/unit/pqueue/pop.cpp
+++ b/tests/unit/pqueue/pop.cpp
@@ -5,7 +5,6 @@
 #include "pqueue/pqueue_type.h"
 
 #include <vector>
-#include <algorithm>    // random_shuffle
 #include <memory>
 
 namespace pqueue {
@@ -77,7 +76,7 @@ namespace pqueue {
                 m_arr.reserve( nEnd - nStart );
                 for ( size_t i = nStart; i < nEnd; ++i )
                     m_arr.push_back( i );
-                std::random_shuffle( m_arr.begin(), m_arr.end() );
+                shuffle( m_arr.begin(), m_arr.end() );
             }
         };
 
diff --git a/tests/unit/pqueue/push.cpp b/tests/unit/pqueue/push.cpp
index 4ce07926..ff9b97b0 100644
--- a/tests/unit/pqueue/push.cpp
+++ b/tests/unit/pqueue/push.cpp
@@ -5,7 +5,6 @@
 #include "pqueue/pqueue_type.h"
 
 #include <vector>
-#include <algorithm>    // random_shuffle
 #include <memory>
 
 namespace pqueue {
@@ -76,7 +75,7 @@ namespace pqueue {
                 m_arr.reserve( nEnd - nStart );
                 for ( size_t i = nStart; i < nEnd; ++i )
                     m_arr.push_back( i );
-                std::random_shuffle( m_arr.begin(), m_arr.end() );
+                shuffle( m_arr.begin(), m_arr.end() );
             }
         };
 
diff --git a/tests/unit/pqueue/push_pop.cpp b/tests/unit/pqueue/push_pop.cpp
index 51c27eba..d53e8596 100644
--- a/tests/unit/pqueue/push_pop.cpp
+++ b/tests/unit/pqueue/push_pop.cpp
@@ -5,7 +5,6 @@
 #include "pqueue/pqueue_type.h"
 
 #include <vector>
-#include <algorithm>    // random_shuffle
 #include <memory>
 
 namespace pqueue {
@@ -80,7 +79,7 @@ namespace pqueue {
                 m_arr.reserve( nEnd - nStart );
                 for ( size_t i = nStart; i < nEnd; ++i )
                     m_arr.push_back( i );
-                std::random_shuffle( m_arr.begin(), m_arr.end() );
+                shuffle( m_arr.begin(), m_arr.end() );
             }
         };
 
diff --git a/tests/unit/set2/set_delodd.cpp b/tests/unit/set2/set_delodd.cpp
index ca033331..3ad6a882 100644
--- a/tests/unit/set2/set_delodd.cpp
+++ b/tests/unit/set2/set_delodd.cpp
@@ -31,7 +31,7 @@ namespace set2 {
         m_arrData.resize( c_nSetSize );
         for ( size_t i = 0; i < c_nSetSize; ++i )
             m_arrData[i] = i;
-        std::random_shuffle( m_arrData.begin(), m_arrData.end() );
+        shuffle( m_arrData.begin(), m_arrData.end() );
     }
 
     void Set_DelOdd::myRun(const char *in_name, bool invert /*= false*/)
diff --git a/tests/unit/set2/set_delodd.h b/tests/unit/set2/set_delodd.h
index b6291a14..e224d1f6 100644
--- a/tests/unit/set2/set_delodd.h
+++ b/tests/unit/set2/set_delodd.h
@@ -2,7 +2,6 @@
 
 #include "cppunit/thread.h"
 #include "set2/set_type.h"
-#include <algorithm> // random_shuffle
 
 namespace set2 {
 
diff --git a/tests/unit/set2/set_insdel_func.h b/tests/unit/set2/set_insdel_func.h
index 88b2ff82..a0635453 100644
--- a/tests/unit/set2/set_insdel_func.h
+++ b/tests/unit/set2/set_insdel_func.h
@@ -418,7 +418,7 @@ namespace set2 {
             m_pKeyLast = m_pKeyFirst + c_nMapSize;
             for ( size_t i = 0; i < c_nMapSize; ++i )
                 m_pKeyArr[i] = i;
-            std::random_shuffle( m_pKeyFirst, m_pKeyLast );
+            shuffle( m_pKeyFirst, m_pKeyLast );
 
             cds::OS::Timer    timer;
 
diff --git a/tests/unit/set2/set_insdelfind.cpp b/tests/unit/set2/set_insdelfind.cpp
index be326ac3..56df57c7 100644
--- a/tests/unit/set2/set_insdelfind.cpp
+++ b/tests/unit/set2/set_insdelfind.cpp
@@ -37,7 +37,7 @@ namespace set2 {
         pFirst = pLast;
         pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
         std::fill( pFirst, pLast, do_find );
-        std::random_shuffle( m_arrShuffle, pLast );
+        shuffle( m_arrShuffle, pLast );
     }
 
     void Set_InsDelFind::myRun(const char *in_name, bool invert /*= false*/)
diff --git a/tests/unit/set2/set_insdelfind.h b/tests/unit/set2/set_insdelfind.h
index fbf82887..bee344df 100644
--- a/tests/unit/set2/set_insdelfind.h
+++ b/tests/unit/set2/set_insdelfind.h
@@ -2,7 +2,6 @@
 
 #include "set2/set_type.h"
 #include "cppunit/thread.h"
-#include <algorithm> // random_shuffle
 
 namespace set2 {
 
@@ -138,7 +137,7 @@ namespace set2 {
                 size_t * pEnd = pInitArr + c_nInitialMapSize;
                 for ( size_t i = 0; i < c_nInitialMapSize; ++i )
                     pInitArr[i] = i * 2 + 1;
-                std::random_shuffle( pInitArr, pEnd );
+                shuffle( pInitArr, pEnd );
                 for ( size_t * p = pInitArr; p < pEnd; ++p )
                     testSet.insert( typename Set::value_type( *p, *p ) );
                 delete [] pInitArr;
-- 
2.34.1