diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp index a14ccf9e5e6c..e24598a9bc12 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + int main() { int ia[] = {1, 2, 3, 4}; @@ -24,7 +26,9 @@ int main() 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)); + LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1)); + assert(std::is_permutation(ia, ia+sa, ia1)); std::random_shuffle(ia, ia+sa); - assert(std::equal(ia, ia+sa, ia2)); + LIBCPP_ASSERT(std::equal(ia, ia+sa, ia2)); + assert(std::is_permutation(ia, ia+sa, ia2)); } diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp index b944c89e3519..967b6e37762b 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "test_macros.h" + struct gen { int operator()(int n) @@ -33,5 +35,6 @@ int main() const unsigned sa = sizeof(ia)/sizeof(ia[0]); gen r; std::random_shuffle(ia, ia+sa, r); - assert(std::equal(ia, ia+sa, ia1)); + LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1)); + assert(std::is_permutation(ia, ia+sa, ia1)); } diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp index 343ae90101ff..0c35ed73ee4c 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + int main() { int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; @@ -25,7 +27,9 @@ int main() const unsigned sa = sizeof(ia)/sizeof(ia[0]); std::minstd_rand g; std::shuffle(ia, ia+sa, g); - assert(std::equal(ia, ia+sa, ia1)); + LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1)); + assert(std::is_permutation(ia, ia+sa, ia1)); std::shuffle(ia, ia+sa, g); - assert(std::equal(ia, ia+sa, ia2)); + LIBCPP_ASSERT(std::equal(ia, ia+sa, ia2)); + assert(std::is_permutation(ia, ia+sa, ia2)); } diff --git a/libcxx/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp b/libcxx/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp index 426586007c1a..c6d24e6334d9 100644 --- a/libcxx/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp @@ -14,9 +14,11 @@ #include #include +#include "test_macros.h" + int main() { std::default_random_engine e; e.discard(9999); - assert(e() == 399268537u); + LIBCPP_ASSERT(e() == 399268537u); }