aboutsummaryrefslogtreecommitdiff
path: root/test/std/algorithms/alg.sorting/alg.min.max
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/algorithms/alg.sorting/alg.min.max')
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp7
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp7
6 files changed, 26 insertions, 8 deletions
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
index e9cd086ab13d..471b08cc6e1f 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
@@ -15,10 +15,13 @@
// max_element(Iter first, Iter last);
#include <algorithm>
+#include <random>
#include <cassert>
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -40,7 +43,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
index e60e156455f3..95c7dee2cdb7 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
@@ -16,11 +16,14 @@
#include <algorithm>
#include <functional>
+#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -42,7 +45,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
index c41884220857..7cd41eaeae46 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
@@ -15,10 +15,13 @@
// min_element(Iter first, Iter last);
#include <algorithm>
+#include <random>
#include <cassert>
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -40,7 +43,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
index c4c6e31eb6dd..402d57dae69e 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
@@ -16,11 +16,14 @@
#include <algorithm>
#include <functional>
+#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -42,7 +45,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
index c2805a656137..acede6ff7b56 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
@@ -15,10 +15,13 @@
// minmax_element(Iter first, Iter last);
#include <algorithm>
+#include <random>
#include <cassert>
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -46,7 +49,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
@@ -66,7 +69,7 @@ test()
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
std::pair<Iter, Iter> p = std::minmax_element(Iter(a), Iter(a+N));
assert(base(p.first) == a);
assert(base(p.second) == a+N-1);
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
index 7840638f742c..ff83d7e55d3d 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
@@ -16,11 +16,14 @@
#include <algorithm>
#include <functional>
+#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
+std::mt19937 randomness;
+
template <class Iter>
void
test(Iter first, Iter last)
@@ -50,7 +53,7 @@ test(int N)
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = i;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
test(Iter(a), Iter(a+N));
delete [] a;
}
@@ -70,7 +73,7 @@ test()
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
- std::random_shuffle(a, a+N);
+ std::shuffle(a, a+N, randomness);
typedef std::greater<int> Compare;
Compare comp;
std::pair<Iter, Iter> p = std::minmax_element(Iter(a), Iter(a+N), comp);