mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Fix portability issues in <random> tests. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user