diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-05-26 17:49:34 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-05-26 17:49:34 +0000 |
commit | f9d540b0624ff755e1903a9a8a708d5ea8190386 (patch) | |
tree | f1fcffffa7b8ad195a60ecc05843f36d7c762b1a /libcxx/test/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp | |
parent | a19838e1076f361c3fde481c515f60a13a64b19f (diff) | |
download | bcm5719-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.cpp | 8 |
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)); } |