summaryrefslogtreecommitdiffstats
path: root/libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-05-26 17:49:34 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-05-26 17:49:34 +0000
commitf9d540b0624ff755e1903a9a8a708d5ea8190386 (patch)
treef1fcffffa7b8ad195a60ecc05843f36d7c762b1a /libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
parenta19838e1076f361c3fde481c515f60a13a64b19f (diff)
downloadbcm5719-llvm-f9d540b0624ff755e1903a9a8a708d5ea8190386.tar.gz
bcm5719-llvm-f9d540b0624ff755e1903a9a8a708d5ea8190386.zip
Completed [alg.random.shuffle].
llvm-svn: 104708
Diffstat (limited to 'libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp')
-rw-r--r--libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp b/libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
index 914f851d09c..ca4a2bdd722 100644
--- a/libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
+++ b/libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
@@ -15,12 +15,16 @@
// random_shuffle(Iter first, Iter last);
#include <algorithm>
-
-#include "../../iterators.h"
+#include <cassert>
int main()
{
int ia[] = {1, 2, 3, 4};
+ int ia1[] = {1, 4, 3, 2};
+ int ia2[] = {4, 1, 2, 3};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
std::random_shuffle(ia, ia+sa);
+ assert(std::equal(ia, ia+sa, ia1));
+ std::random_shuffle(ia, ia+sa);
+ assert(std::equal(ia, ia+sa, ia2));
}
OpenPOWER on IntegriCloud